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
TypeErrorwhen comparing aware and naive values, and silent wall-clock shifts from dropping tzinfo before conversion.- Parameters
value –
datetime,pd.Timestamp, ISO string, or null-like value.- Returns
Naive UTC datetime, or
Nonefor null-like values.- Return type