Previous topic

The nova.openstack.common.setup Module

Next topic

The nova.policy Module

This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.openstack.common.timeutils Module

Time related utilities and helper functions.

advance_time_delta(timedelta)

Advance overriden time using a datetime.timedelta.

advance_time_seconds(seconds)

Advance overriden time by seconds.

clear_time_override()

Remove the overridden time.

is_older_than(before, seconds)

Return True if before is older than seconds.

isotime(at=None)

Stringify time in ISO 8601 format

normalize_time(timestamp)

Normalize time in arbitrary timezone to UTC

parse_isotime(timestr)

Parse time from ISO 8601 format

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

Turn a formatted time back into a datetime.

set_time_override(override_time=datetime.datetime(2012, 7, 6, 15, 50, 31, 902363))

Override utils.utcnow to return a constant time.

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

Returns formatted utcnow.

utcnow()

Overridable version of utils.utcnow.

utcnow_ts()

Timestamp version of our utcnow function.