From 5c632fdb0fbc1f63baebc6ff5ed4ee8f6255f41f Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Thu, 19 Sep 2024 12:09:10 -0700 Subject: [PATCH] Clean up. --- lib/typing/ext/parse_test.go | 1 + lib/typing/ext/variables.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/typing/ext/parse_test.go b/lib/typing/ext/parse_test.go index 9732a6d17..63510b76b 100644 --- a/lib/typing/ext/parse_test.go +++ b/lib/typing/ext/parse_test.go @@ -40,6 +40,7 @@ func TestParseFromInterface(t *testing.T) { value, err := ParseFromInterface("2024-09-19T16:05:18.630Z", TimestampTzKindType) assert.NoError(t, err) assert.Equal(t, "2024-09-19T16:05:18.630Z", value.String("")) + assert.Equal(t, RFC3339MillisecondUTC, value.nestedKind.Format) } } diff --git a/lib/typing/ext/variables.go b/lib/typing/ext/variables.go index 75e7b0231..bda6d8812 100644 --- a/lib/typing/ext/variables.go +++ b/lib/typing/ext/variables.go @@ -11,9 +11,8 @@ const ( ) var supportedDateTimeLayouts = []string{ + RFC3339MillisecondUTC, time.RFC3339Nano, - // TODO: This should be pulled into `TIMESTAMP_NTZ` - "2006-01-02T15:04:05.000Z", // RFC 3339 without timezone ISO8601, time.Layout, time.ANSIC, @@ -39,7 +38,8 @@ var SupportedTimeFormats = []string{ // RFC3339 variants const ( - RFC3339Millisecond = "2006-01-02T15:04:05.000Z07:00" - RFC3339Microsecond = "2006-01-02T15:04:05.000000Z07:00" - RFC3339Nanosecond = "2006-01-02T15:04:05.000000000Z07:00" + RFC3339MillisecondUTC = "2006-01-02T15:04:05.000Z" + RFC3339Millisecond = "2006-01-02T15:04:05.000Z07:00" + RFC3339Microsecond = "2006-01-02T15:04:05.000000Z07:00" + RFC3339Nanosecond = "2006-01-02T15:04:05.000000000Z07:00" )