[GODRIVER-1514] Extended JSON $date incorrectly parses single-digit hours Created: 03/Mar/20  Updated: 12/Mar/20  Resolved: 12/Mar/20

Status: Closed
Project: Go Driver
Component/s: JSON & ExtJSON
Affects Version/s: 1.3.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: David Golden Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

 The driver incorrectly parses a single-digit hour for $date:

{"":{"$date":"0070-01-01T0:00:00Z"}}

It should error because ISO 8601 (and RFC-3339) require a two-digit hour.

This turns out to be a Go bug (#37616), but can be fixed by changing the parsing format string to 2006-01-02T03:04:05Z07:00 custom validation.



 Comments   
Comment by Divjot Arora (Inactive) [ 12/Mar/20 ]

Closing because this is really an issue in Go. The Go language team has said that they don't want to change the constant in the time package. We think it's best to keep parity with the language here and it makes our parser slightly too lenient, not too strict, so a user with well-formed data wouldn't run into this.

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