libera_utils.time.to_date#
- libera_utils.time.to_date(value: str | date | datetime) date#
Normalize a date-like value to its UTC calendar date.
- Parameters:
value (str, datetime.date, or datetime) – An ISO 8601 date or datetime string, a
datetime, or adate. A timezone-aware datetime is converted to UTC first; a naive one is taken as UTC.- Returns:
The UTC calendar date.
- Return type:
- Raises:
ValueError – If
valueis a string that is not ISO 8601.