propertime.utilities

Time manipulation utilities

Functions

as_tz(dt, tz)

Get a datetime object as if it was on the given time zone.

correct_dt_dst(dt)

Correct the DST of a datetime object, by re-creating it.

dt(*args, **kwargs)

Initialize a datetime object with the time zone in the proper way.

dt_from_s(s[, tz])

Create a datetime object from epoch seconds.

dt_from_str(string[, tz])

Create a datetime object from a string.

get_tz_offset(dt)

Get the time zone offset, in seconds.

is_dt_ambiguous_without_offset(dt)

Check if a datetime object is specified in an ambigous way on a given time zone

is_dt_inconsistent(dt)

Check that a datetieme object is consistent with its time zone (some conditions can lead to have summer time set in winter, or to end up in non-existent times as when changing DST).

is_numerical(item)

Check if the argument is numerical.

now_dt([tz])

Return the current time in datetime format.

now_s()

Return the current time in epoch seconds.

s_from_dt(dt[, tz])

Return the epoch seconds from a datetime object, with floating point for milliseconds/microseconds.

str_from_dt(dt)

Return the a string representation of a datetime object (as IS08601).

timezonize(tz)

Convert a string representation of a time zone to its pytz object, or do nothing if the argument is already a pytz time zone or tzoffset, or None.