ia64/xen-unstable
changeset 17353:d24f37b31030
xend: Improve localtime calculation -- Python time module already
provides the relevant information.
From: Ross Walker <rwalker@medallion.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
provides the relevant information.
From: Ross Walker <rwalker@medallion.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Mon Mar 31 10:40:43 2008 +0100 (2008-03-31) |
parents | 5dfdf95db75c |
children | d434c73ec8b7 |
files | tools/python/xen/xend/XendDomainInfo.py |
line diff
1.1 --- a/tools/python/xen/xend/XendDomainInfo.py Mon Mar 31 10:37:19 2008 +0100 1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py Mon Mar 31 10:40:43 2008 +0100 1.3 @@ -2047,11 +2047,10 @@ class XendDomainInfo: 1.4 1.5 try: 1.6 if self.info['platform'].get('localtime', 0): 1.7 - t = time.time() 1.8 - loc = time.localtime(t) 1.9 - utc = time.gmtime(t) 1.10 - timeoffset = int(time.mktime(loc) - time.mktime(utc)) 1.11 - self.info['platform']['rtc_timeoffset'] = timeoffset 1.12 + if time.localtime(time.time())[8]: 1.13 + self.info['platform']['rtc_timeoffset'] = -time.altzone 1.14 + else: 1.15 + self.info['platform']['rtc_timeoffset'] = -time.timezone 1.16 1.17 self.image = image.create(self, self.info) 1.18