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:
Keir Fraser committed 2008-03-31 10:40:43 +01:00
1 parent 6e6b79115c
commit e358d917c4
1 file changed
+4 -5
+4 -5
View File
@@ -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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.