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
Stumbled on this strange behavior, consider myself as a bug, what do you think?
Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ciso8601
>>> ciso8601.parse_datetime("2020-02-28T23:00:00Z")
datetime.datetime(2020, 2, 28, 23, 0, tzinfo=datetime.timezone.utc)
>>> ciso8601.parse_datetime("2020-02-28T24:00:00Z")
datetime.datetime(2020, 2, 29, 0, 0, tzinfo=datetime.timezone.utc)
>>> ciso8601.parse_datetime("2020-02-28T25:00:00Z")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: hour must be in 0..23
It is not only passes "24" hour, but also returns different date. Logic is obvious (next day, 00 hour), but behavior is incorrect IMHO "2020-02-28T24:00:00Z" != datetime.datetime(2020, 2, 29, 0, 0, tzinfo=datetime.timezone.utc)
Also, 24 is not in range 00..23
The text was updated successfully, but these errors were encountered:
Hello!
Stumbled on this strange behavior, consider myself as a bug, what do you think?
It is not only passes "24" hour, but also returns different date. Logic is obvious (next day, 00 hour), but behavior is incorrect IMHO
"2020-02-28T24:00:00Z" != datetime.datetime(2020, 2, 29, 0, 0, tzinfo=datetime.timezone.utc)
Also, 24 is not in range 00..23
The text was updated successfully, but these errors were encountered: