mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 13:33:09 +00:00
tahoe_backup.py: tolerate more time formats
This commit is contained in:
parent
1c24707f19
commit
809ec25ffa
@ -44,6 +44,17 @@ def parse_old_timestamp(s, options):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
# "2008-11-16 10.34.56 PM" (localtime)
|
||||||
|
if s[-3:] in (" AM", " PM"):
|
||||||
|
# this might raise ValueError
|
||||||
|
when = time.strptime(s[:-3], "%Y-%m-%d %I.%M.%S")
|
||||||
|
if s[-3:] == "PM":
|
||||||
|
when += 12*60*60
|
||||||
|
return when
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# "2008-12-31 18.21.43"
|
# "2008-12-31 18.21.43"
|
||||||
when = time.strptime(s, "%Y-%m-%d %H.%M.%S")
|
when = time.strptime(s, "%Y-%m-%d %H.%M.%S")
|
||||||
|
Loading…
Reference in New Issue
Block a user