Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-884

Default for timestamps is a zero'd *time.Location, instead of `nil`

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.1
    • Affects Version/s: 1.0.0
    • Component/s: BSON

      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.

            Assignee:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Reporter:
            jloy Jeremy Loy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: