Index: Doc/includes/tzinfo-examples.py =================================================================== --- Doc/includes/tzinfo-examples.py (revision 62106) +++ Doc/includes/tzinfo-examples.py (working copy) @@ -87,11 +87,16 @@ dt += timedelta(days_to_go) return dt -# In the US, DST starts at 2am (standard time) on the first Sunday in April. -DSTSTART = datetime(1, 4, 1, 2) -# and ends at 2am (DST time; 1am standard time) on the last Sunday of Oct. -# which is the first Sunday on or after Oct 25. -DSTEND = datetime(1, 10, 25, 1) +# In the US, DST starts at 2am (standard time) on the second Sunday in March, +# which is the first Sunday on or after Mar 8. +DSTSTART = datetime(1, 3, 8, 2) +# and ends at 2am (DST time; 1am standard time) on the first Sunday of Nov. +DSTEND = datetime(1, 11, 1, 1) +# Before 2007, DST used to start at 2am (standard time) on the first Sunday +# in April and to end at 2am (DST time; 1am standard time) on the last Sunday +# of October, which is the first Sunday on or after Oct 25. +DSTSTARTOLD = datetime(1, 4, 1, 2) +DSTENDOLD = datetime(1, 10, 25, 1) class USTimeZone(tzinfo): @@ -122,7 +127,10 @@ return ZERO assert dt.tzinfo is self - # Find first Sunday in April & the last in October. + # Find second Sunday in March & the first in November if the year + # is higher than 2007, first in April and last in October otherwise. + if dt.year < 2007: + DSTSTART, DSTEND = DSTSTARTOLD, DSTENDOLD start = first_sunday_on_or_after(DSTSTART.replace(year=dt.year)) end = first_sunday_on_or_after(DSTEND.replace(year=dt.year))