Skip to content

Fix image entity using naive datetime causing wrong timezone display#1053

Open
clee704 wants to merge 1 commit intoblakeblackshear:masterfrom
clee704:fix/image-naive-datetime
Open

Fix image entity using naive datetime causing wrong timezone display#1053
clee704 wants to merge 1 commit intoblakeblackshear:masterfrom
clee704:fix/image-naive-datetime

Conversation

@clee704
Copy link

@clee704 clee704 commented Feb 16, 2026

Summary

datetime.datetime.now() returns a naive datetime (no timezone info). Home Assistant treats naive datetimes as UTC when rendering, so the Person (and other object) image entities display timestamps in UTC instead of the user's configured timezone.

Fix

Use datetime.datetime.now(datetime.timezone.utc) to make it timezone-aware so HA correctly converts it for display.

Fixes #1052

datetime.datetime.now() returns a naive datetime (no timezone info).
Home Assistant treats naive datetimes as UTC when rendering, so the
Person image entity displays timestamps in UTC instead of the user's
configured timezone.

Use datetime.datetime.now(datetime.timezone.utc) to make it
timezone-aware so HA correctly converts it for display.

Fixes blakeblackshear#1052

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NickM-27 NickM-27 added the bug Something isn't working label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image entity uses naive datetime, causing wrong timezone display in HA

2 participants

Comments