Time related utilities and helper functions.
Advance overridden time using a datetime.timedelta.
Advance overridden time by seconds.
Remove the overridden time.
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).
Return True if after is newer than seconds.
Return True if before is older than seconds.
Determines if time is going to happen in the next window seconds.
| Parameters: |
|
|---|---|
| Returns: | True if expiration is within the given duration |
Returns an iso8601 formatted date from timestamp.
Stringify time in ISO 8601 format.
Make an rpc-safe datetime with microseconds.
Note: tzinfo is stripped, but not required for relative times.
Normalize time in arbitrary timezone to UTC naive object.
Parse time from ISO 8601 format.
Turn a formatted time back into a datetime.
Overrides utils.utcnow.
Make it return a constant time or a list thereof, one at a time.
| Parameters: | override_time – datetime instance or list thereof. If not given, defaults to the current UTC time. |
|---|
Returns formatted utcnow.
Return the total seconds of datetime.timedelta object.
Compute total seconds of datetime.timedelta, datetime.timedelta doesn’t have method total_seconds in Python2.6, calculate it manually.
Unmarshall a datetime dict.
Overridable version of utils.utcnow.
Timestamp version of our utcnow function.