Use timezone-aware UTC datetimes for timestamp conversions

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/ea784ce3-2c1c-45f8-ad6d-46e92cf15ed7

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-29 15:45:26 +00:00
parent e51fbe755e
commit 6329d3aa35
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional
from fastapi import APIRouter, HTTPException, Path, Query, status
@@ -318,7 +318,7 @@ def _build_compliance_timeline(store: ReportStore, domain: str) -> List[Timeline
# Use begin_date to determine the day of this report
begin = report.get("begin_date", 0)
if isinstance(begin, (int, float)) and begin > 0:
date_str = datetime.fromtimestamp(begin).strftime("%Y-%m-%d")
date_str = datetime.fromtimestamp(begin, tz=timezone.utc).strftime("%Y-%m-%d")
elif isinstance(begin, str):
# Handle ISO-format strings
try: