Skip to main content

datetime_to_time

Function datetime_to_time 

Source
pub fn datetime_to_time(value: &Bound<'_, PyAny>) -> PyResult<Time<UTC>>
Expand description

Convert a timezone-aware Python datetime.datetime to canonical tempoch UTC.

Non-UTC offsets are normalized to UTC. Naive datetimes and non-datetime objects are rejected with Python exceptions.