mirror of
https://github.com/skoelle/calender_sync.git
synced 2026-09-17 18:20:24 +00:00
fix: replace deprecated datetime.utcnow() with datetime.now(timezone.utc)
This commit is contained in:
+2
-2
@@ -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",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user