Invalid daylight saving time for Italy CET in 1976
In 1976, Italy, the daylight saving time starts at may 30 and ends at september 26. However pytz reports always +1 hour (UTC+1) and not +2 (UTC+1 +1 hour for daylight saving time). This problem affects all dates before 1976-09-27.
# --- sample code
import datetime
import pytz
d1 = datetime.
d2 = datetime.
cet = pytz.timezone(
d1z = cet.localize(d1)
d2z = cet.localize(d2)
#-------
results:
d1z is "1976-09-26 00:00:00+01:00" <---- it should have been +02
d2z is "1976-09-27 00:00:00+01:00" <---- ok
Tried Pendulum and it seems having the same problem.
In Javascript it works:
new Date(1976, 8, 26) is "Sun Sep 26 1976 00:00:00 GMT+0200 (Ora legale dell’Europa centrale)"
new Date(1976, 8, 27) is "Mon Sep 27 1976 00:00:00 GMT+0100 (Ora standard dell’Europa centrale)"
references: https:/
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- pytz Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Angelo for more information if necessary.