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

[Xen-changelog] [xen-unstable] Make date time handling slightly more permissive



# HG changeset patch
# User Tom Wilkie <tom.wilkie@xxxxxxxxx>
# Date 1176220900 -3600
# Node ID 28efbe0ea4901511171e06ec44b1d1023186220c
# Parent  4add9eb83f7fc8590b4a698a272d3a7b4665734c
Make date time handling slightly more permissive

signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
---
 tools/python/xen/xm/main.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -r 4add9eb83f7f -r 28efbe0ea490 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Mon Apr 09 17:09:21 2007 +0100
+++ b/tools/python/xen/xm/main.py       Tue Apr 10 17:01:40 2007 +0100
@@ -732,8 +732,10 @@ def xm_restore(args):
 
 
 def datetime_to_secs(v):
-    return time.mktime(time.strptime(str(v) + 'UTC', '%Y%m%dT%H:%M:%S%Z'))
-
+    unwanted = ":-."
+    for c in unwanted:
+        v = str(v).replace(c, "")
+    return time.mktime(time.strptime(v[0:14], '%Y%m%dT%H%M%S'))
 
 def getDomains(domain_names, state, full = 0):
     if serverType == SERVER_XEN_API:

_______________________________________________
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®.