Time improvements.

This commit is contained in:
Nuno Cruces
2023-02-24 10:50:16 +00:00
parent 627df5db0f
commit fcd33d2f0f
5 changed files with 72 additions and 14 deletions

View File

@@ -9,7 +9,7 @@ import (
// if it roundtrips back to the same string.
// This way times can be persisted to, and recovered from, the database,
// but if a string is needed, [database/sql] will recover the same string.
func maybeDate(text string) driver.Value {
func maybeTime(text string) driver.Value {
// Weed out (some) values that can't possibly be
// [time.RFC3339Nano] timestamps.
if len(text) < len("2006-01-02T15:04:05Z") {