utils.timeutil module

This module should contain all things associated with time or date that can be shared.

utils.timeutil.nice_seconds(t_s)[source]

Return nicer representation of seconds

class utils.timeutil.parsetime[source]

Bases: datetime.datetime

Modified class with loaders for our datetime formats.

classmethod from_american_date_only(time_string)[source]

Convert the string representation of the time into parsetime()

CFME’s format here is ‘mm/dd/yy’

Parameters:time_string – String with time to parse

Returns: :py:class`utils.timeutil.datetime()` object

classmethod from_american_minutes(time_string)[source]

Convert the string representation of the time into parsetime()

CFME’s format here is ‘mm/dd/yy hh:mm’

Parameters:time_string – String with time to parse

Returns: :py:class`utils.timeutil.datetime()` object

classmethod from_american_with_utc(time_string)[source]

Convert the string representation of the time into parsetime()

CFME’s format here is ‘mm/dd/yy hh:mm:ss UTC’

Parameters:time_string – String with time to parse

Returns: :py:class`utils.timeutil.datetime()` object

classmethod from_iso_date(time_string)[source]

Convert the string representation of the time into parsetime()

Format here is ‘YYYY-MM-DD’

Parameters:time_string – String with time to parse

Returns: :py:class`utils.timeutil.datetime()` object

classmethod from_iso_with_utc(time_string)[source]

Convert the string representation of the time into parsetime()

CFME’s format here is ‘mm-dd-yy hh:mm:ss UTC’

Parameters:time_string – String with time to parse

Returns: :py:class`utils.timeutil.datetime()` object

classmethod from_request_format(time_string)[source]

Convert the string representation of the time into parsetime()

Format here is ‘YYYY-MM-DD-HH-MM-SS’. Used for transmitting data over http

Parameters:time_string – String with time to parse

Returns: :py:class`utils.timeutil.datetime()` object

to_american_date_only()[source]

Convert the this object to string representation in american date only format.

CFME’s format here is ‘mm/dd/yy’

Returns: :py:class`str` object

to_american_minutes()[source]

Convert the this object to string representation in american with just minutes.

CFME’s format here is ‘mm/dd/yy hh:mm’

Returns: :py:class`str` object

to_american_with_utc()[source]

Convert the this object to string representation in american with UTC.

CFME’s format here is ‘mm/dd/yy hh:mm:ss UTC’

Returns: :py:class`str` object

to_iso_date()[source]

Convert the this object to string representation in ISO format.

Format here is ‘YYYY-MM-DD’

Returns: :py:class`str` object

to_iso_with_utc()[source]

Convert the this object to string representation in american with UTC.

CFME’s format here is ‘mm-dd-yy hh:mm:ss UTC’

Returns: :py:class`str` object

to_request_format()[source]

Convert the this object to string representation in http request.

Format here is ‘YYYY-MM-DD-HH-MM-SS’

Returns: :py:class`str` object