[GODRIVER-2811]  Use UTC when marshalling primitive.DateTime as JSON Created: 13/Apr/23  Updated: 28/Oct/23  Resolved: 17/Apr/23

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.12.0

Type: Improvement Priority: Unknown
Reporter: Matt Dale Assignee: Matt Dale
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Documentation Changes: Not Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

Tracks community-submitted PR 1227:

Summary

Make the JSON format of primitive.DateTime use UTC, consistent with the relaxed extJSON format.

Background & Motivation

Marshalling in relaxed extJSON already uses UTC, which makes sense since the type has no timezone information.
Using local time in JSON does not appear to have been intentional, as there is no comment or test for this behavior.
Using UTC allows the JSON to be deterministic with respect to the BSON, rather than depend on the environment.


Generated at Thu Feb 08 08:39:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.