duplicity.dup_time module

Provide time related exceptions and functions

exception duplicity.dup_time.TimeException[source]

Bases: exceptions.Exception

duplicity.dup_time.cmp(time1, time2)[source]

Compare time1 and time2 and return -1, 0, or 1

duplicity.dup_time.genstrtotime(timestr, override_curtime=None)[source]

Convert a generic time string to a time in seconds

duplicity.dup_time.gettzd(dstflag)[source]

Return w3’s timezone identification string.

Expresed as [+/-]hh:mm. For instance, PST is -08:00. Zone is coincides with what localtime(), etc., use.

duplicity.dup_time.intstringtoseconds(interval_string)[source]

Convert a string expressing an interval (e.g. “4D2s”) to seconds

duplicity.dup_time.inttopretty(seconds)[source]

Convert num of seconds to readable string like “2 hours”.

duplicity.dup_time.setcurtime(time_in_secs=None)[source]

Sets the current time in curtime and curtimestr

duplicity.dup_time.setprevtime(time_in_secs)[source]

Sets the previous time in prevtime and prevtimestr

duplicity.dup_time.stringtopretty(timestring)[source]

Return pretty version of time given w3 time string

duplicity.dup_time.stringtotime(timestring)[source]

Return time in seconds from w3 or duplicity timestring

If there is an error parsing the string, or it doesn’t look like a valid datetime string, return None.

duplicity.dup_time.timetopretty(timeinseconds)[source]

Return pretty version of time

duplicity.dup_time.timetostring(timeinseconds)[source]

Return w3 or duplicity datetime compliant listing of timeinseconds

duplicity.dup_time.tzdtoseconds(tzd)[source]

Given w3 compliant TZD, return how far ahead UTC is