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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206978013 -3600
# Node ID 11efc5dc5d2c98010c47ac7689fd953815ed3cc5
# Parent  d8b4af5bde97b6e6058d28b34233fd2b2e9703c9
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 d8b4af5bde97 -r 11efc5dc5d2c tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 31 16:39:47 2008 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 31 16:40:13 2008 +0100
@@ -1706,11 +1706,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®.