1.1 --- a/imiptools/dates.py Sat Sep 19 22:09:25 2015 +0200
1.2 +++ b/imiptools/dates.py Sat Sep 19 23:01:37 2015 +0200
1.3 @@ -132,7 +132,10 @@
1.4
1.5 def get_duration(value):
1.6
1.7 - "Return a duration for the given 'value'."
1.8 + """
1.9 + Return a duration for the given 'value' as a timedelta object.
1.10 + Where no valid duration is specified, None is returned.
1.11 + """
1.12
1.13 if not value:
1.14 return None
1.15 @@ -433,11 +436,19 @@
1.16 else:
1.17 return None, None
1.18
1.19 -def get_timestamp():
1.20 +def get_timestamp(offset=None):
1.21
1.22 "Return the current time as an iCalendar-compatible string."
1.23
1.24 - return format_datetime(to_timezone(datetime.utcnow(), "UTC"))
1.25 + offset = offset or timedelta(0)
1.26 + return format_datetime(to_timezone(datetime.utcnow(), "UTC") + offset)
1.27 +
1.28 +def get_time(offset=None):
1.29 +
1.30 + "Return the current time."
1.31 +
1.32 + offset = offset or timedelta(0)
1.33 + return to_timezone(datetime.utcnow(), "UTC") + offset
1.34
1.35 def get_tzid(dtstart_attr, dtend_attr):
1.36