mirror of
https://github.com/esphome/esphome.git
synced 2026-08-31 10:06:03 +00:00
[core] Replace deprecated datetime.utcfromtimestamp() (#15503)
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user