diff --git a/homeassistant/components/filesize/sensor.py b/homeassistant/components/filesize/sensor.py index 97fe5f5511d..22b8cd60d79 100644 --- a/homeassistant/components/filesize/sensor.py +++ b/homeassistant/components/filesize/sensor.py @@ -137,9 +137,10 @@ class FileSizeCoordinator(DataUpdateCoordinator): raise UpdateFailed(f"Can not retrieve file statistics {error}") from error size = statinfo.st_size - last_updated = datetime.fromtimestamp(statinfo.st_mtime).replace( + last_updated = datetime.utcfromtimestamp(statinfo.st_mtime).replace( tzinfo=dt_util.UTC ) + _LOGGER.debug("size %s, last updated %s", size, last_updated) data: dict[str, int | float | datetime] = { "file": round(size / 1e6, 2),