mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
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>
This commit is contained in:
1 parent
6e6b79115c
commit
e358d917c4
1 file changed
+4
-5
@@ -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)
|
||||
|
||||
|
||||