normalise_datetime_to_naive_utc

Documentation for eth_defi.vault.top_vaults_json.normalise_datetime_to_naive_utc function.

normalise_datetime_to_naive_utc(value)

Normalise timestamp-like values to naive UTC datetimes.

Tz-aware Pandas and Python timestamps are converted to UTC first and only then stripped of tzinfo. This avoids both TypeError when comparing aware and naive values, and silent wall-clock shifts from dropping tzinfo before conversion.

Parameters

valuedatetime, pd.Timestamp, ISO string, or null-like value.

Returns

Naive UTC datetime, or None for null-like values.

Return type

Optional[datetime.datetime]