[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: Improve localtime calculation -- Python time module already



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206956443 -3600
# Node ID d24f37b31030bdc9305e40a9a71846e6f79909d7
# Parent  5dfdf95db75c90c95109418ae10aa88228be797a
xend: Improve localtime calculation -- Python time module already
provides the relevant information.

From: Ross Walker <rwalker@xxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -r 5dfdf95db75c -r d24f37b31030 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 31 10:37:19 2008 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 31 10:40:43 2008 +0100
@@ -2047,11 +2047,10 @@ class XendDomainInfo:
 
         try:
             if self.info['platform'].get('localtime', 0):
-                t = time.time()
-                loc = time.localtime(t)
-                utc = time.gmtime(t)
-                timeoffset = int(time.mktime(loc) - time.mktime(utc))
-                self.info['platform']['rtc_timeoffset'] = timeoffset
+                if time.localtime(time.time())[8]:
+                    self.info['platform']['rtc_timeoffset'] = -time.altzone
+                else:
+                    self.info['platform']['rtc_timeoffset'] = -time.timezone
 
             self.image = image.create(self, self.info)
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.