We are currently in the process of migrating away from `mgo`, and to the official driver (thank you for making it!).
In order to perform the migration smoothly, we are writing a suite of parity integration tests, verifying the exact behavior differences between the two libraries. (e.g. reflect.DeepEqual on two objects, one returned from `mgo` the other from official)
One of our parity tests is failing, in regards to time zone translation when marshaling/un-marshaling a Golang `time.Time`. `mgo` sets the internal `*time.Location` as `nil`, while the official driver sets it to a zero value.
I believe `nil` is actually more correct, as this mirrors what the standard library does. See `time.go#192`. When the time is set to `UTC`, it actually sets `loc` to `nil`.
Because `time.Location` is set to the zero value, this is the representation of the time to default to system location, rather than UTC.
- backported by
-
GODRIVER-949 Backport "Default for timestamps is a zero'd *time.Location, instead of `nil`"
- Closed
- is duplicated by
-
GODRIVER-923 zero time values should not loose timezone fidelity
- Closed