Expand description
Reusable PyO3 interoperability for Python datetimes and tempoch UTC values.
Python inputs must be timezone-aware. Fixed offsets are normalized to UTC,
and all scientific time handling is delegated to tempoch.
let instant = tempoch_py::interop::datetime_to_time(value)?;
tempoch_py::interop::time_to_datetime(value.py(), instant)Functionsยง
- datetime_
to_ time - Convert a timezone-aware Python
datetime.datetimeto canonical tempoch UTC. - datetime_
to_ time_ with - Convert with an explicit tempoch
TimeContext. - period_
to_ datetimes - Convert a canonical tempoch UTC period to Python start/end datetimes.
- period_
to_ datetimes_ with - Convert a UTC period with an explicit tempoch
TimeContext. - time_
to_ datetime - Convert canonical tempoch UTC to a timezone-aware UTC Python datetime.
- time_
to_ datetime_ with - Convert to a Python datetime with an explicit tempoch
TimeContext.