1.1 --- a/imiptools/dates.py Tue Mar 24 16:14:55 2015 +0100
1.2 +++ b/imiptools/dates.py Tue Mar 24 18:14:09 2015 +0100
1.3 @@ -249,6 +249,18 @@
1.4
1.5 return date(dt.year, dt.month, dt.day)
1.6
1.7 +def to_datetime(dt, tzid):
1.8 +
1.9 + """
1.10 + Return a datetime for 'dt', using the start of day for dates, and using the
1.11 + 'tzid' for the conversion.
1.12 + """
1.13 +
1.14 + if isinstance(dt, datetime):
1.15 + return dt
1.16 + else:
1.17 + return get_start_of_day(dt, tzid)
1.18 +
1.19 def get_start_of_day(dt, tzid):
1.20
1.21 """