# glance.common.timeutils module

Time related utilities and helper functions.

glance.common.timeutils.delta_seconds(before, after)

  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)

  Returns an iso8601 formatted date from timestamp.

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

  Stringify time in ISO 8601 format.

glance.common.timeutils.normalize_time(timestamp)

  Normalize time in arbitrary timezone to UTC naive object.

glance.common.timeutils.parse_isotime(timestr)

  Parse time from ISO 8601 format.

glance.common.timeutils.utcnow(with_timezone=False)

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

this page last updated: 2026-03-19 01:38:33

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug