[go-nuts] Give the zero time value a location, and it won't survive a roundtrip to JSON?

2020-11-27 Thread 'Robert Ma' via golang-nuts
Hi all, Time is complicated. Today I found myself in a rabbit hole. For some unrelated reason, I got a time value in a non-UTC location that's otherwise zero (IsZero=true). This value doesn't seem to survive a roundtrip to JSON. See this playground for a minimal reproduction: https://play.gola

[go-nuts] Re: Give the zero time value a location, and it won't survive a roundtrip to JSON?

2020-11-27 Thread 'Robert Ma' via golang-nuts
Is this because the 2-second offset of LMT gets lost in RFC 3339 representation? On Fri, Nov 27, 2020 at 6:33 PM Robert Ma wrote: > Hi all, > > Time is complicated. > > Today I found myself in a rabbit hole. For some unrelated reason, I got a > time value in a non-UTC location that's otherwise z