-
-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
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
Wrong hour in timezone "Africa/Cairo" from 2023 #706
Comments
This is caused by pendulum release 2.1.2 referencing (now) obsolete IANA zoneinfo, specifically 2022.1. As a temporary fix, to force pendulum 2.1.2 to use either the system zoneinfo, or (on Windows), the zoneinfo from the first party module tzdata, put the following into your python import path as (for example) pendulum_212_fix.py, and after you
|
Thanks for the solution! But, I am using the pendulum module built inside Airflow, specifically MWAA in AWS. So, I guess I have to wait for them to make this patch. |
I think this is indeed a bug, but the example seems incorrect:
So, Cairo (EET) being normally UTC+2, the correct test case would be >>> pendulum.__version__
'2.1.2'
>>> pendulum.datetime(2023, 4, 27, 21).in_timezone('Africa/Cairo')
DateTime(2023, 4, 27, 23, 0, 0, tzinfo=Timezone('Africa/Cairo'))
>>> pendulum.datetime(2023, 4, 27, 22).in_timezone('Africa/Cairo')
DateTime(2023, 4, 28, 0, 0, 0, tzinfo=Timezone('Africa/Cairo')) # Should be 1 A.M. FWIW this does seem to be fixed in Pendulum 3.0.0b1: >>> pendulum.__version__
'3.0.0b1'
>>> pendulum.datetime(2023, 4, 27, 21).in_timezone('Africa/Cairo')
DateTime(2023, 4, 27, 23, 0, 0, tzinfo=Timezone('Africa/Cairo'))
>>> pendulum.datetime(2023, 4, 27, 22).in_timezone('Africa/Cairo')
DateTime(2023, 4, 28, 1, 0, 0, tzinfo=Timezone('Africa/Cairo')) |
Fixed in Pendulum 3.0 |
Issue
In 2023, Cairo has started daylight saving in 2023 on 2023-04-27T21:00:00 UTC.
This 2023-04-27T21:00:00 UTC should be local time 2023-04-28T00:00:00 (Cairo time). However, in pendulumn this is still converted to 2023-04-27T23:00:00 (Cairo time)
Please see the replay below:
Basically, pendumlum is not implementing daylight saving for Africa/Cairo time.
This is related to this issue: #700 where Mexico has made the similar decision in 2023.
The text was updated successfully, but these errors were encountered: