[GODRIVER-1688] primitive.NewDateTimeFromTime only allows years between 1678 and 2262 Created: 14/Jul/20  Updated: 28/Oct/23  Resolved: 22/Jul/20

Status: Closed
Project: Go Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 1.4.0, 1.3.6

Type: Bug Priority: Minor - P4
Reporter: Nikola Irinchev Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to GODRIVER-983 extjson date parser doesn't work for ... Closed

 Description   

Due to internally calling `time.UnixNano`, `primitive.NewDateTimeFromTime` is artificially limiting the range of dates supported. Instead, it should get the unix seconds from the time argument and add them to the nanoseconds divided by a million.



 Comments   
Comment by Githook User [ 22/Jul/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1688 Remove UnixNano call from NewDateTimeFromTime (#463)
Branch: release/1.3
https://github.com/mongodb/mongo-go-driver/commit/f8480f188e5e37515e08140cc000494a3f192f93

Comment by Githook User [ 22/Jul/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1688 Remove UnixNano call from NewDateTimeFromTime (#463)
Branch: release/1.4
https://github.com/mongodb/mongo-go-driver/commit/787294248ef48dfe8438886f2282d05ee8730df5

Comment by Githook User [ 22/Jul/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1688 Remove UnixNano call from NewDateTimeFromTime (#463)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/745a7b8563fe34e45aafa9c024944e9f28d6b652

Comment by Divjot Arora (Inactive) [ 21/Jul/20 ]

https://github.com/mongodb/mongo-go-driver/pull/463

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