[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7760 - trunk/gnue-common/src/utils
From: |
johannes |
Subject: |
[gnue] r7760 - trunk/gnue-common/src/utils |
Date: |
Fri, 29 Jul 2005 04:29:57 -0500 (CDT) |
Author: johannes
Date: 2005-07-29 04:29:56 -0500 (Fri, 29 Jul 2005)
New Revision: 7760
Modified:
trunk/gnue-common/src/utils/GDateTime.py
Log:
Don't be too critical on the number of digits given in extended format
Modified: trunk/gnue-common/src/utils/GDateTime.py
===================================================================
--- trunk/gnue-common/src/utils/GDateTime.py 2005-07-29 06:59:14 UTC (rev
7759)
+++ trunk/gnue-common/src/utils/GDateTime.py 2005-07-29 09:29:56 UTC (rev
7760)
@@ -272,7 +272,15 @@
# Make sure to have the timepart in basic format
if ':' in timepart:
- timepart = timepart.replace (':', '')
+ items = timepart.split (':')
+ for (ix, i) in enumerate (items):
+ if '.' in i:
+ full, frac = i.split ('.')
+ items [ix] = "%02d.%s" % (int (full), frac)
+ else:
+ items [ix] = "%02d" % int (i)
+
+ timepart = ''.join (items)
# Use UTC timezone if the string contains a Z (=Zulu time)
if zone == 'Z':
@@ -412,4 +420,5 @@
check ('1321.3+0312')
check ('1321-12:34')
check ('2005-07-27 24:00+02')
+ check ('6:2:1.233')
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7760 - trunk/gnue-common/src/utils,
johannes <=