mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Logbook: Query databse as_utc(). dt: Use pytz's localize (#2521)
This commit is contained in:
parent
88b3aa54a8
commit
a60a342864
@ -94,6 +94,7 @@ class LogbookView(HomeAssistantView):
|
||||
else:
|
||||
start_day = dt_util.start_of_local_day()
|
||||
|
||||
start_day = dt_util.as_utc(start_day)
|
||||
end_day = start_day + timedelta(days=1)
|
||||
|
||||
events = recorder.get_model('Events')
|
||||
|
@ -92,8 +92,7 @@ def start_of_local_day(dt_or_d=None):
|
||||
elif isinstance(dt_or_d, dt.datetime):
|
||||
dt_or_d = dt_or_d.date()
|
||||
|
||||
return dt.datetime.combine(dt_or_d, dt.time()).replace(
|
||||
tzinfo=DEFAULT_TIME_ZONE)
|
||||
return DEFAULT_TIME_ZONE.localize(dt.datetime.combine(dt_or_d, dt.time()))
|
||||
|
||||
|
||||
# Copyright (c) Django Software Foundation and individual contributors.
|
||||
|
Loading…
x
Reference in New Issue
Block a user