]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/util/time_format.py
util/time_format.py: accept space separator, add unit tests
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / util / time_format.py
index 63b5770dc566d146bacaa6c43cf8429cb7f4d7eb..98d32e491a0e4adbaec156a0da0d250655bdbfa0 100644 (file)
@@ -14,7 +14,7 @@ def iso_utc(now=None, sep='_', t=time.time):
         now = t()
     return datetime.datetime.utcfromtimestamp(now).isoformat(sep)
 
-def iso_utc_time_to_localseconds(isotime, _conversion_re=re.compile(r"(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})[T_](?P<hour>\d{2}):(?P<minute>\d{2}):(?P<second>\d{2})(?P<subsecond>\.\d+)?")):
+def iso_utc_time_to_localseconds(isotime, _conversion_re=re.compile(r"(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})[T_ ](?P<hour>\d{2}):(?P<minute>\d{2}):(?P<second>\d{2})(?P<subsecond>\.\d+)?")):
     """
     The inverse of iso_utc().