You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
parse fails with subsecond decimals with more than 9 digits #935
I have searched the issues of this repo and believe that this is not a duplicate.
OS version and name: Win10
Pendulum version: 3.1.0
Issue
pendulum.parse() trhows ParseError when parsing an ISO8601 formatted date with subsecond decimals with more than 9 digits, independent on whether time offset is present or not.
For instance, the following parse attempt work (truncating decimals to microsecond resolution):
It is expected that truncation (or even better rounding) to microseconds is applied independent of the number of digits present in the string.
My current workaround is to extract the fractional part of the seconds, parse it as a float, and then add it to the DateTime instance (which accomplishes the rounding):
Activity