Invalid daylight saving time for Italy CET in 1976

Bug #1807700 reported by Angelo
10
This bug affects 2 people
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.datetime(1976, 9, 26, 0, 0, 0, 0) # Last day in which daylight saving time is in effect
d2 = datetime.datetime(1976, 9, 27, 0, 0, 0, 0) # First dat after daylight saving time

cet = pytz.timezone("CET")

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://www.timeanddate.com/time/change/italy?year=1976

Revision history for this message
Stuart Bishop (stub) wrote :

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.

Changed in pytz:
status: New → Invalid
Revision history for this message
Angelo (gorgoroth) wrote :

I forgot to mention that I tried "Europe/Rome" with same results.

Revision history for this message
Angelo (gorgoroth) wrote :

I reopened this bug report because even changing the timezone to "Europe/Rome" does not solve.

Changed in pytz:
status: Invalid → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.