baseplate.lib.datetime

Extensions to the standard library datetime module.

baseplate.lib.datetime.datetime_to_epoch_milliseconds(dt)[source]

Convert datetime object to epoch milliseconds.

Return type

int

baseplate.lib.datetime.datetime_to_epoch_seconds(dt)[source]

Convert datetime object to epoch seconds.

Return type

int

baseplate.lib.datetime.epoch_milliseconds_to_datetime(ms)[source]

Convert epoch milliseconds to UTC datetime.

Return type

datetime

baseplate.lib.datetime.epoch_seconds_to_datetime(sec)[source]

Convert epoch seconds to UTC datetime.

Return type

datetime

baseplate.lib.datetime.get_utc_now()[source]

Get current offset-aware datetime which has timezone information.

Return type

datetime