Logbook: Query databse as_utc(). dt: Use pytz's localize (#2521)

This commit is contained in:
Johann Kellerman authored and Paulus Schoutsen committed 2016-07-13 18:45:55 -07:00
1 parent 88b3aa54a8
commit a60a342864
2 files changed
+2 -2

No files matched your search

+1
View File
@@ -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')
+1 -2
View File
@@ -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.