We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While working on a followup to #116035, given:
>>> from datetime import datetime, timedelta >>> from zoneinfo import ZoneInfo >>> t = datetime(2024, 10, 27, 1, tzinfo=ZoneInfo('Europe/London'), fold=0) >>> str(t) '2024-10-27 01:00:00+01:00' >>> t2 = t + timedelta(minutes=30) >>> t2 datetime.datetime(2024, 10, 27, 1, 30, tzinfo=zoneinfo.ZoneInfo(key='Europe/London')) >>> str(t2) '2024-10-27 01:30:00+01:00'
I noticed this buggy behaviour:
>>> t3 = t + timedelta(minutes=60) >>> str(t3) '2024-10-27 02:00:00+00:00' >>> t3 datetime.datetime(2024, 10, 27, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/London'))
The correct answer would be:
>>> datetime(2024, 10, 27, 1, tzinfo=ZoneInfo('Europe/London'), fold=1) datetime.datetime(2024, 10, 27, 1, 0, fold=1, tzinfo=zoneinfo.ZoneInfo(key='Europe/London')) >>> str(datetime(2024, 10, 27, 1, tzinfo=ZoneInfo('Europe/London'), fold=1)) '2024-10-27 01:00:00+00:00'
Similarly, given:
>>> t1 = datetime(2024, 3, 31, 0, tzinfo=ZoneInfo('Europe/London')) >>> t1 datetime.datetime(2024, 3, 31, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/London')) >>> str(t1) '2024-03-31 00:00:00+00:00'
This is incorrect:
>>> t2 = t1 + timedelta(minutes=60) >>> t2 datetime.datetime(2024, 3, 31, 1, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/London')) >>> str(t2) '2024-03-31 01:00:00+00:00'
The above point in time doesn't exist, it should be:
>>> str(datetime(2024, 3, 31, 2, 0, tzinfo=ZoneInfo(key='Europe/London'))) '2024-03-31 02:00:00+01:00'
3.12
No response
The text was updated successfully, but these errors were encountered:
#116038 probably related...
Sorry, something went wrong.
No branches or pull requests
Bug description:
While working on a followup to #116035, given:
I noticed this buggy behaviour:
The correct answer would be:
Similarly, given:
This is incorrect:
The above point in time doesn't exist, it should be:
CPython versions tested on:
3.12
Operating systems tested on:
No response
The text was updated successfully, but these errors were encountered: