You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #141009 - emmanuel-ferdman:master, r=marcoieni
Migrate to modern datetime API
# PR Summary
This small PR resolves the `datetime` library warnings:
```python
DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). or datetime.datetime.utcnow()
```
Note that `.replace(tzinfo=None)` allows to keep the original behavior where the time appears as a naive UTC timestamp (i.e., without any timezone offset). Comparision:
```python
# With .utcnow() or .now(datetime.timezone.utc).replace(tzinfo=None)
Time,Idle
2025-05-14T15:40:25.013414,98.73417721518987
# With .now(datetime.timezone.utc)
Time,Idle
2025-05-14T15:40:25.013414+00:00,98.73417721518987
```
0 commit comments