Google calendar and timezones

I get the wrong start and end date and time of an event? Is there an issue with timezones? See screenshot. Has anybody seen this already?

The event you show is an all day event. I’m willing to bet you live in +1 GMT. I have an all day event in the system today and it starts at 5 am and ends at 5 am tomorrow. Live in EST -5.

I’m guessing that the start time is 0 GMT and then adjusted to your time zone.

@keith-michael: You are right. I live in GMT+1.

I noticed that all day events have a weird offset, but I assumed that to be a Google thing. Might be an issue with the component. My all-day events begin at 5am. I live at -5 GMT.

@mnestor: Could this be an issue?

Yes, timezone math is a PITA. I tried to get it and test but failed it looks like. I will be back on a computer Tuesday and have the week off so will try to knock it out.

Although, that might just be a display issue? Did it trigger at the right time? Midnight

@mnestor: Oh sorry, i can’t say whether it was triggerd at midnight.

I believe that the calendar component assumes that all times are in the timezone the user has configured in HASS. But this isn’t the case. Each calendar can have it’s own timezone. For example, I have 3 calendars:

Calendar 1: GMT -5, HASS -5, difference: 0, accurate in sensor
Calendar 2: GMT -8, HASS -5, difference: 3, inaccurate in sensor
Calender 3: GMT +0, HASS -5, difference -5, inaccurate in sensor

The all_day: true issue is separate, but related. Here’s some insight:

Basically, the start_time and end_time for an all_day event should not take into account timezone at all, so that the timestamp always looks like YYYY-MM-DD 00:00:00.

I think I fixed this issue - here’s the PR if anyone wants to try it:

1 Like

It seems to have broken it for me in 0.36.1