Closed MethodGrab closed 6 years ago
In our codebase we have ISO date strings without the fraction of second (SSS). Various documents seem to indicate that the fraction of second can be optional so both of these should be valid:
Iso8601.toTime "2018-01-01T12:00:00.000Z" Iso8601.toTime "2018-01-01T12:00:00Z"
This PR updates the toTime parser to succeed with and without a fraction of second.
toTime
If necessary for a particular application, the standard supports the addition of a decimal fraction to the smallest time value in the representation. -- https://en.wikipedia.org/wiki/ISO_8601#General_principles The brackets indicate that the fraction of seconds component is optional. -- https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2005/ms190977(v=sql.90)
If necessary for a particular application, the standard supports the addition of a decimal fraction to the smallest time value in the representation. -- https://en.wikipedia.org/wiki/ISO_8601#General_principles
The brackets indicate that the fraction of seconds component is optional. -- https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2005/ms190977(v=sql.90)
Thanks @MethodGrab!
In our codebase we have ISO date strings without the fraction of second (SSS). Various documents seem to indicate that the fraction of second can be optional so both of these should be valid:
This PR updates the
toTime
parser to succeed with and without a fraction of second.