cterasdk.common.datetime_utils module

cterasdk.common.datetime_utils module#

class cterasdk.common.datetime_utils.DateTimeUtils#

Bases: object

static get_expiration_date(expiration)#

Get a datetime.date representation of the expiration date

Parameters:

expiration (variable,optional) – The expiration value. Pass datetime.date for a specific date, integer for days from now, or True for immediate (yesterday)

Return datetime.date:

datetime.date representation of the expiration date

cterasdk.common.datetime_utils.from_iso_format(time)#

Parse datetime object from ISO 8601 format

Parameters:

time (str) – Timestamp

Returns:

Datetime object

Return type:

datetime.datetime