From 0e3222e44a68c4723117b856561e235801d1bbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 20 Oct 2021 11:13:59 +0300 Subject: [PATCH 1/2] Fix timezone formatting in RFC 3339 output UTC or other time zone names or abbreviations are not valid there, need to have Z or [-+]hh:mm. --- cmd/ulid/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ulid/main.go b/cmd/ulid/main.go index ee4173b..55b12d8 100644 --- a/cmd/ulid/main.go +++ b/cmd/ulid/main.go @@ -14,7 +14,7 @@ import ( const ( defaultms = "Mon Jan 02 15:04:05.999 MST 2006" - rfc3339ms = "2006-01-02T15:04:05.999MST" + rfc3339ms = "2006-01-02T15:04:05.999Z07:00" ) func main() { From bc3416326b02405a8b6bf8efcc1eb079a90b72db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 20 Oct 2021 22:26:52 +0300 Subject: [PATCH 2/2] Use fixed 3 digits for RFC 3339 fractional seconds Co-authored-by: Peter Bourgon --- cmd/ulid/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ulid/main.go b/cmd/ulid/main.go index 55b12d8..50e62cc 100644 --- a/cmd/ulid/main.go +++ b/cmd/ulid/main.go @@ -14,7 +14,7 @@ import ( const ( defaultms = "Mon Jan 02 15:04:05.999 MST 2006" - rfc3339ms = "2006-01-02T15:04:05.999Z07:00" + rfc3339ms = "2006-01-02T15:04:05.000Z07:00" ) func main() {