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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206978113 -3600
# Node ID fe766402a150c57f1dfaa9c13bc7606dfa237a7b
# Parent  b7a6855a710ddcd6a5066d96fcb592c1f0fb576b
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>
xen-unstable changeset:   17323:d24f37b31030bdc9305e40a9a71846e6f79909d7
xen-unstable date:        Mon Mar 31 10:40:43 2008 +0100
---
 tools/python/xen/xend/XendDomainInfo.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -r b7a6855a710d -r fe766402a150 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 31 16:41:24 2008 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 31 16:41:53 2008 +0100
@@ -1583,11 +1583,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®.