Ticket #6023: localtimezone_fix.diff
File localtimezone_fix.diff, 1.3 KB (added by , 17 years ago) |
---|
-
django/utils/tzinfo.py
54 54 55 55 def _isdst(self, dt): 56 56 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) 58 63 tt = time.localtime(stamp) 59 64 return tt.tm_isdst > 0 -
tests/regressiontests/dateformat/tests.py
66 66 67 67 >>> format(my_birthday, r'jS o\f F') 68 68 u'8th of July' 69 70 >>> format(the_future, r'Y') 71 u'2100' 69 72 """ 70 73 71 74 from django.utils import dateformat, translation … … 84 87 my_birthday = datetime.datetime(1979, 7, 8, 22, 00) 85 88 summertime = datetime.datetime(2005, 10, 30, 1, 00) 86 89 wintertime = datetime.datetime(2005, 10, 30, 4, 00) 90 the_future = datetime.datetime(2100, 10, 25, 0, 00)