icalendar.tools module#

Utility functions for icalendar.

icalendar.tools.is_date(dt: date) bool[source]#

Whether this is a date and not a datetime.

icalendar.tools.is_datetime(dt: date) bool[source]#

Whether this is a date and not a datetime.

icalendar.tools.is_pytz(tz: tzinfo)[source]#

Whether the timezone requires localize() and normalize().

icalendar.tools.is_pytz_dt(dt: date)[source]#

Whether the time requires localize() and normalize().

icalendar.tools.normalize_pytz(dt: date)[source]#

We have to normalize the time after a calculation if we use pytz.

pytz requires this function to be used in order to correctly calculate the timezone’s offset after calculations.

icalendar.tools.to_datetime(dt: date) datetime[source]#

Make sure we have a datetime, not a date.