Timing utilities#

commons.timing.get_current_utc() datetime#

Fetch a UTC timezone aware datetime.

Returns:

The current UTC time as an aware datetime.

Return type:

datetime.datetime

commons.timing.is_within_next_(current_datetime: datetime, expected_datetime: datetime, delta: timedelta = datetime.timedelta(seconds=300)) bool#

Returns true if the times are within X minutes of each other

Parameters:
Returns:

True if times within the given delta.

Return type:

bool

commons.timing.is_in_the_past(current_datetime: datetime, expected_datetime: datetime) bool#

Returns True if the datetime is in the past.