-
-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Description
Hi,
I have this test code which started to fail with the latest release of pytz:
assert utc_str(datetime(2020, 1, 1, 0, 0, 0, 0, tzinfo=pytz.timezone("GMT"))) == "2020-01-01T00:00:00Z"and fails with this error:
E AssertionError: assert '2019-12-31T23:42:00Z' == '2019-12-31T23:00:00Z'
The utc_str function boils down to:
def utc_str(dt: datetime) -> str:
return dt.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")It works as expected in pytz 2024.1.
Am I doing something wrong?
Thanks for clarification!
hannesortmeier, backbord, AndersKOlsson, andy-maier and ChristianCiach
Metadata
Metadata
Assignees
Labels
No labels