Convert a datetime string to milliseconds since epoch.
(val)
| 15 | |
| 16 | |
| 17 | def _datetime_str_to_ms(val): |
| 18 | """Convert a datetime string to milliseconds since epoch.""" |
| 19 | dt = datetime.datetime.fromisoformat(val.replace("Z", "+00:00")) |
| 20 | if dt.tzinfo is None: |
| 21 | dt = dt.replace(tzinfo=datetime.timezone.utc) |
| 22 | return dt.timestamp() * 1000 |
| 23 | |
| 24 | |
| 25 | def _ms_to_datetime_str(ms): |