I encountered an issue with parsing an ISO8601 timestamp when the ".000Z" is included. This used to work as expected in my previously used version v2.0.1, but this to not work anymore.
Consider the following code:
carbon.Parse("2022-04-01T23:00:00.000Z").IsZero()
golang version: 1.18
carbon version: v2.1.9
I expected to get:
false
But I actually get:
true
On a quick investigation, it seems that the removal of the following block might be the cause of the issue:
Going to close this issue — seems like I answered my own question with the example posted. The solution was to simply use ParseByLayout with RFC3339Format as the layout.
Hello,
I encountered an issue with parsing an ISO8601 timestamp when the ".000Z" is included. This used to work as expected in my previously used version v2.0.1, but this to not work anymore.
Consider the following code:
golang version: 1.18
carbon version: v2.1.9
I expected to get:
But I actually get:
On a quick investigation, it seems that the removal of the following block might be the cause of the issue:
carbon/parser.go
Line 25 in f0fe61d
Noticed this only happened when upgraded to v2.1.9
Thanks!
The text was updated successfully, but these errors were encountered: