Index: django/utils/tzinfo.py
===================================================================
--- django/utils/tzinfo.py	(revision 6710)
+++ django/utils/tzinfo.py	(working copy)
@@ -54,6 +54,11 @@
 
     def _isdst(self, dt):
         tt = (dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.weekday(), 0, -1)
-        stamp = time.mktime(tt)
+        try:
+            stamp = time.mktime(tt)
+        except OverflowError:
+            # 32 bit systems can't handle dates after Jan 2038
+            tt = (2037,) + tt[1:]
+            stamp = time.mktime(tt)
         tt = time.localtime(stamp)
         return tt.tm_isdst > 0
Index: tests/regressiontests/dateformat/tests.py
===================================================================
--- tests/regressiontests/dateformat/tests.py	(revision 6710)
+++ tests/regressiontests/dateformat/tests.py	(working copy)
@@ -66,6 +66,9 @@
 
 >>> format(my_birthday, r'jS o\f F')
 u'8th of July'
+
+>>> format(the_future, r'Y')
+u'2100'
 """
 
 from django.utils import dateformat, translation
@@ -84,3 +87,4 @@
 my_birthday = datetime.datetime(1979, 7, 8, 22, 00)
 summertime = datetime.datetime(2005, 10, 30, 1, 00)
 wintertime = datetime.datetime(2005, 10, 30, 4, 00)
+the_future = datetime.datetime(2100, 10, 25, 0, 00)
