Functions
framework.helpers.datetime Namespace Reference

Functions

str datetime_suffix (*bool seconds=False)
 
str iso8601_utc_time (Optional[datetime.timedelta] timedelta=None)
 
str shorten_utc_zone (str utc_datetime_str)
 
datetime.datetime utc_now ()
 

Function Documentation

◆ datetime_suffix()

str framework.helpers.datetime.datetime_suffix ( *bool   seconds = False)
Return current UTC date, and time in a format useful for resource naming.

Examples:
    - 20210626-1859   (seconds=False)
    - 20210626-185942 (seconds=True)
Use in resources names incompatible with ISO 8601, e.g. some GCP resources
that only allow lowercase alphanumeric chars and dashes.

Hours and minutes are joined together for better readability, so time is
visually distinct from dash-separated date.

Definition at line 40 of file datetime.py.

◆ iso8601_utc_time()

str framework.helpers.datetime.iso8601_utc_time ( Optional[datetime.timedelta]   timedelta = None)
Return datetime relative to current in ISO-8601 format, UTC tz.

Definition at line 32 of file datetime.py.

◆ shorten_utc_zone()

str framework.helpers.datetime.shorten_utc_zone ( str  utc_datetime_str)
Replace ±00:00 timezone designator with Z (zero offset AKA Zulu time).

Definition at line 27 of file datetime.py.

◆ utc_now()

datetime.datetime framework.helpers.datetime.utc_now ( )
Construct a datetime from current time in UTC timezone.

Definition at line 22 of file datetime.py.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:10