verri.dates
¶
Utility functions related to dates and times.
Note
All date-related values used by Verri use UTC as a timezone to ensure independence of the timezone when creating a version.
verri.dates.now() -> dt.datetime
¶
The current timezone-aware date and time, in UTC.
Returns:
| Type | Description |
|---|---|
datetime
|
The current date and time in UTC, timezone-aware. |
verri.dates.midnight(ts: dt.datetime | None = None) -> dt.datetime
¶
Midnight of the current or a specified date, in UTC.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
datetime | None
|
A specific date to turn into midnight (defaults to the current date). Note that this needs to be a timezone aware datetime, a naive one will be rejected. |
None
|
Returns:
| Type | Description |
|---|---|
datetime
|
A |