diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-02-01 08:13:05 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-02-01 08:13:05 +0000 |
commit | 64976e6afefff455ee9515218942a65c6ff5eede (patch) | |
tree | cbe6d3965de77e0ebf6159eec15f24730cc5bf60 /rdiff-backup/rdiff_backup/Time.py | |
parent | a5207ada368bf6a9eb31e8c094124dbf2cc1175e (diff) | |
download | rdiff-backup-64976e6afefff455ee9515218942a65c6ff5eede.tar.gz |
Re-added --windows-mode option
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@273 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/Time.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/Time.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/rdiff-backup/rdiff_backup/Time.py b/rdiff-backup/rdiff_backup/Time.py index ea85ca4..bdcfb52 100644 --- a/rdiff-backup/rdiff_backup/Time.py +++ b/rdiff-backup/rdiff_backup/Time.py @@ -61,9 +61,8 @@ def setprevtime_local(timeinseconds, timestr): def timetostring(timeinseconds): """Return w3 datetime compliant listing of timeinseconds""" - return time.strftime("%Y-%m-%dT%H" + Globals.time_separator + - "%M" + Globals.time_separator + "%S", - time.localtime(timeinseconds)) + gettzd() + s = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(timeinseconds)) + return s + gettzd() def stringtotime(timestring): """Return time in seconds from w3 timestring @@ -75,8 +74,7 @@ def stringtotime(timestring): try: date, daytime = timestring[:19].split("T") year, month, day = map(int, date.split("-")) - hour, minute, second = map(int, - daytime.split(Globals.time_separator)) + hour, minute, second = map(int, daytime.split(":")) assert 1900 < year < 2100, year assert 1 <= month <= 12 assert 1 <= day <= 31 @@ -154,15 +152,13 @@ def gettzd(): hours, minutes = map(abs, divmod(offset, 60)) assert 0 <= hours <= 23 assert 0 <= minutes <= 59 - return "%s%02d%s%02d" % (prefix, hours, - Globals.time_separator, minutes) + return "%s%02d:%02d" % (prefix, hours, minutes) def tzdtoseconds(tzd): """Given w3 compliant TZD, return how far ahead UTC is""" if tzd == "Z": return 0 assert len(tzd) == 6 # only accept forms like +08:00 for now - assert (tzd[0] == "-" or tzd[0] == "+") and \ - tzd[3] == Globals.time_separator + assert (tzd[0] == "-" or tzd[0] == "+") and tzd[3] == ":" return -60 * (60 * int(tzd[:3]) + int(tzd[4:])) def cmp(time1, time2): |