[Pkg-bazaar-commits] ./bzr/unstable r49: fix local-time-offset calculation

mbp at sourcefrog.net mbp at sourcefrog.net
Fri Apr 10 07:26:34 UTC 2009


------------------------------------------------------------
revno: 49
committer: mbp at sourcefrog.net
timestamp: Sat 2005-03-19 01:41:44 +0000
message:
  fix local-time-offset calculation
modified:
  bzrlib/osutils.py
  doc/thanks.txt
-------------- next part --------------
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py	2005-03-12 07:16:39 +0000
+++ b/bzrlib/osutils.py	2005-03-19 01:41:44 +0000
@@ -174,8 +174,9 @@
 
 
 
-def local_time_offset():
-    if time.daylight:
+def local_time_offset(t=None):
+    """Return offset of local zone from GMT, either at present or at time t."""
+    if time.localtime(t).tm_isdst and time.daylight:
         return -time.altzone
     else:
         return -time.timezone
@@ -197,7 +198,7 @@
         tt = time.gmtime(t + offset)
     elif timezone == 'local':
         tt = time.localtime(t)
-        offset = local_time_offset()
+        offset = local_time_offset(t)
     else:
         bailout("unsupported timezone format %r",
                 ['options are "utc", "original", "local"'])

=== modified file 'doc/thanks.txt'
--- a/doc/thanks.txt	2005-03-15 05:03:33 +0000
+++ b/doc/thanks.txt	2005-03-19 01:41:44 +0000
@@ -18,6 +18,7 @@
 * Luke Gorrie
 * Dan Nicolaescu
 * Tim Parkin
+* Scott James Remnant
 
 Sponsor
 -------



More information about the Pkg-bazaar-commits mailing list