fix: replace deprecated datetime.utcnow() with datetime.now(timezone.utc)

This commit is contained in:
2026-08-01 16:42:46 +02:00
parent 73337406ad
commit 911924d627
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import logging import logging
from datetime import datetime from datetime import datetime, timezone
from pathlib import Path from pathlib import Path
from fastapi import FastAPI, HTTPException, Query from fastapi import FastAPI, HTTPException, Query
@@ -95,7 +95,7 @@ def get_events(
return EventsListResponse( return EventsListResponse(
events=events, events=events,
count=len(events), count=len(events),
query_time=datetime.utcnow().isoformat() + "Z", query_time=datetime.now(timezone.utc).replace(tzinfo=None).isoformat() + "Z",
) )
+1 -1
View File
@@ -209,7 +209,7 @@ def ping_healthcheck():
def run_sync_once(): def run_sync_once():
run_ts = datetime.utcnow().replace(microsecond=0) run_ts = datetime.now(timezone.utc).replace(tzinfo=None, microsecond=0)
window_start = run_ts - timedelta(days=WINDOW_PAST_DAYS) window_start = run_ts - timedelta(days=WINDOW_PAST_DAYS)
window_end = run_ts + timedelta(days=WINDOW_FUTURE_DAYS) window_end = run_ts + timedelta(days=WINDOW_FUTURE_DAYS)