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
datetime objects with time zone info break the serializatin because __str__ doesn't output in the format that monty expects. Example: datetime.datetime(2018, 12, 19, 21, 45, 41, 99000, tzinfo=datetime.timezone.utc).__str__()
yields "2018-12-19 21:45:41.099000+00:00"
When deserializing, this causes monty to throw an error because the two datetime formatting strings it tries are:
"%Y-%m-%d %H:%M:%S.%f"
"%Y-%m-%d %H:%M:%S"
resulting in value error like this from within strptime: ValueError: unconverted data remains: .967000+00:00
We could just add the timezone format, or just use a formatting string when outputting from datetime to a string during serialization. There are also generic datetime parsing libraries like dateutil
The text was updated successfully, but these errors were encountered:
datetime objects with time zone info break the serializatin because
__str__
doesn't output in the format that monty expects. Example:datetime.datetime(2018, 12, 19, 21, 45, 41, 99000, tzinfo=datetime.timezone.utc).__str__()
yields
"2018-12-19 21:45:41.099000+00:00"
When deserializing, this causes monty to throw an error because the two datetime formatting strings it tries are:
resulting in value error like this from within
strptime
:ValueError: unconverted data remains: .967000+00:00
We could just add the timezone format, or just use a formatting string when outputting from datetime to a string during serialization. There are also generic datetime parsing libraries like
dateutil
The text was updated successfully, but these errors were encountered: