changeset 719:7c4ee496794c

dst
author Jeff Hammel <k0scist@gmail.com>
date Mon, 03 Nov 2014 10:36:06 -0800
parents cd9d65e6e2ab
children f136912c81a9
files python/epoch2date.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/python/epoch2date.py	Thu Oct 30 15:22:29 2014 -0700
+++ b/python/epoch2date.py	Mon Nov 03 10:36:06 2014 -0800
@@ -52,7 +52,11 @@
         # output
         if not options.display_utc:
             print ("{} seconds since epoch".format(s))
-            print ("{} {}".format(dt, time.tzname[time.daylight]))
+            if time.daylight and time.localtime(s).tm_isdst:
+                tz_index = 1
+            else:
+                tz_index = 0
+            print ("{} {}".format(dt, time.tzname[tz_index]))
         print ("{} UTC".format(dt2))
 
 if __name__ == '__main__':