Invalid daylight saving time for Italy CET in 1976
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pytz |
New
|
Undecided
|
Unassigned |
Bug Description
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 (Chrome) 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:/
Use pytz.timezone( "Europe/ Rome") for Italy's timezone. CET is deprecated (like all non-Region/City zonenames), for the very reason that often individual regions do not follow the same rules as their surrounding regions.