glance.common.timeutils module

Time related utilities and helper functions.

glance.common.timeutils.delta_seconds(before, after)[source]

Return the difference between two timing objects.

Compute the difference in seconds between two date, time, or datetime objects (as a float, to microsecond resolution).

glance.common.timeutils.iso8601_from_timestamp(timestamp, microsecond=False)[source]

Returns an iso8601 formatted date from timestamp.

glance.common.timeutils.isotime(at=None, subsecond=False)[source]

Stringify time in ISO 8601 format.


Normalize time in arbitrary timezone to UTC naive object.


Parse time from ISO 8601 format.


Overridable version of utils.utcnow that can return a TZ-aware datetime.