Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion appdaemon/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,4 +966,11 @@ def convert_naive(self, dt):
return result

def make_naive(self, dt: datetime) -> datetime:
return dt.replace(tzinfo=None)
"""Convert a timezone-aware datetime to a naive datetime in local timezone.

This is used for display purposes only. The scheduler internally works
with timezone-aware UTC datetimes.
"""
# Convert from UTC to local timezone, then strip timezone info
local_dt = dt.astimezone(self.AD.tz)
return local_dt.replace(tzinfo=None)
Loading