[core] Replace deprecated datetime.utcfromtimestamp() (#15503)

This commit is contained in:
Jonathan Swoboda
2026-04-06 21:31:57 -04:00
committed by GitHub
parent 82dc80a413
commit b8b8d1bb15
+3 -3
View File
@@ -1,6 +1,6 @@
from __future__ import annotations
from datetime import datetime
from datetime import UTC, datetime
import logging
from pathlib import Path
@@ -27,8 +27,8 @@ def has_remote_file_changed(url: str, local_file_path: Path) -> bool:
_LOGGER.debug("has_remote_file_changed: File exists at %s", local_file_path)
try:
local_modification_time = local_file_path.stat().st_mtime
local_modification_time_str = datetime.utcfromtimestamp(
local_modification_time
local_modification_time_str = datetime.fromtimestamp(
local_modification_time, tz=UTC
).strftime("%a, %d %b %Y %H:%M:%S GMT")
headers = {