mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Fix GTFS sensor wrong timezone (#26580)
This commit is contained in:
parent
f53fcacf49
commit
7dfdec531c
@ -122,7 +122,7 @@ def get_next_departure(
|
|||||||
include_tomorrow: bool = False,
|
include_tomorrow: bool = False,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
"""Get the next departure for the given schedule."""
|
"""Get the next departure for the given schedule."""
|
||||||
now = datetime.datetime.now() + offset
|
now = dt_util.now().replace(tzinfo=None) + offset
|
||||||
now_date = now.strftime(dt_util.DATE_STR_FORMAT)
|
now_date = now.strftime(dt_util.DATE_STR_FORMAT)
|
||||||
yesterday = now - datetime.timedelta(days=1)
|
yesterday = now - datetime.timedelta(days=1)
|
||||||
yesterday_date = yesterday.strftime(dt_util.DATE_STR_FORMAT)
|
yesterday_date = yesterday.strftime(dt_util.DATE_STR_FORMAT)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user