fix handling of daylight saving time
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 31 Oct 2005 10:56:42 -0700
changeset 1482 4d38b85e60aa
parent 1481 acd1832ebf31
child 1483 a4ba63e04134
fix handling of daylight saving time
mercurial/util.py
--- a/mercurial/util.py	Sat Oct 29 13:45:01 2005 -0700
+++ b/mercurial/util.py	Mon Oct 31 10:56:42 2005 -0700
@@ -610,10 +610,12 @@
         s = f.read(size)
 
 def makedate():
-    t = time.time()
-    if time.daylight: tz = time.altzone
-    else: tz = time.timezone
-    return t, tz
+    lt = time.localtime()
+    if lt[8] == 1 and time.daylight:
+        tz = time.altzone
+    else:
+        tz = time.timezone
+    return time.mktime(lt), tz
 
 def datestr(date=None, format='%c'):
     """represent a (unixtime, offset) tuple as a localized time.