Ticket #6023: localtimezone_fix.diff

File localtimezone_fix.diff, 1.3 KB (added by Chris Beaven, 17 years ago)
  • django/utils/tzinfo.py

     
    5454
    5555    def _isdst(self, dt):
    5656        tt = (dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.weekday(), 0, -1)
    57         stamp = time.mktime(tt)
     57        try:
     58            stamp = time.mktime(tt)
     59        except OverflowError:
     60            # 32 bit systems can't handle dates after Jan 2038
     61            tt = (2037,) + tt[1:]
     62            stamp = time.mktime(tt)
    5863        tt = time.localtime(stamp)
    5964        return tt.tm_isdst > 0
  • tests/regressiontests/dateformat/tests.py

     
    6666
    6767>>> format(my_birthday, r'jS o\f F')
    6868u'8th of July'
     69
     70>>> format(the_future, r'Y')
     71u'2100'
    6972"""
    7073
    7174from django.utils import dateformat, translation
     
    8487my_birthday = datetime.datetime(1979, 7, 8, 22, 00)
    8588summertime = datetime.datetime(2005, 10, 30, 1, 00)
    8689wintertime = datetime.datetime(2005, 10, 30, 4, 00)
     90the_future = datetime.datetime(2100, 10, 25, 0, 00)
Back to Top