The novaclient.openstack.common.timeutils Module

Time related utilities and helper functions.

novaclient.openstack.common.timeutils.advance_time_delta(timedelta)

Advance overridden time using a datetime.timedelta.

novaclient.openstack.common.timeutils.advance_time_seconds(seconds)

Advance overridden time by seconds.

novaclient.openstack.common.timeutils.clear_time_override()

Remove the overridden time.

novaclient.openstack.common.timeutils.is_newer_than(after, seconds)

Return True if after is newer than seconds.

novaclient.openstack.common.timeutils.is_older_than(before, seconds)

Return True if before is older than seconds.

novaclient.openstack.common.timeutils.isotime(at=None)

Stringify time in ISO 8601 format

novaclient.openstack.common.timeutils.marshall_now(now=None)

Make an rpc-safe datetime with microseconds.

Note: tzinfo is stripped, but not required for relative times.

novaclient.openstack.common.timeutils.normalize_time(timestamp)

Normalize time in arbitrary timezone to UTC naive object

novaclient.openstack.common.timeutils.parse_isotime(timestr)

Parse time from ISO 8601 format

novaclient.openstack.common.timeutils.parse_strtime(timestr, fmt='%Y-%m-%dT%H:%M:%S.%f')

Turn a formatted time back into a datetime.

novaclient.openstack.common.timeutils.set_time_override(override_time=datetime.datetime(2013, 9, 19, 11, 55, 17, 147668))

Override utils.utcnow to return a constant time.

novaclient.openstack.common.timeutils.strtime(at=None, fmt='%Y-%m-%dT%H:%M:%S.%f')

Returns formatted utcnow.

novaclient.openstack.common.timeutils.unmarshall_time(tyme)

Unmarshall a datetime dict.

novaclient.openstack.common.timeutils.utcnow()

Overridable version of utils.utcnow.

novaclient.openstack.common.timeutils.utcnow_ts()

Timestamp version of our utcnow function.

This Page