src.dackar.RCA._timeutils¶
Shared date/time helpers for the RCA package.
Consolidates the parse_dt / utcnow_iso helpers that were previously
defined only in orchestrators.causality_engine_v32 and reached for by
importing that module directly. Centralizing them here lets leaf packages
(e.g. pm_compliance) stay independently importable rather than depending on
the orchestrator module that lands later in the pipeline (MR#56 review B1/A1).
parse_dt normalizes naive inputs to UTC-aware datetimes so downstream
comparisons and min() / max() never mix offset-naive and offset-aware
values.
Functions¶
Return the current UTC time as an ISO-8601 string. |
|
|
Parse an ISO-8601 timestamp into a UTC-aware |
Module Contents¶
- src.dackar.RCA._timeutils.utcnow_iso()[source]¶
Return the current UTC time as an ISO-8601 string.
- Return type:
str
- src.dackar.RCA._timeutils.parse_dt(value)[source]¶
Parse an ISO-8601 timestamp into a UTC-aware
datetime.A naive input (no offset, e.g.
"2024-01-01T00:00:00") is assumed to be UTC and stamped withtimezone.utc; offset-aware inputs (...+00:00/...Z) are preserved. ReturnsNonewhen value is empty or cannot be parsed.- Parameters:
value (Optional[str])
- Return type:
Optional[datetime.datetime]