n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
47.37k stars 7.1k forks source link

Wrong start / end time for recurring calendar events from different timezone after daylight savings change #11264

Open gabrielwhite opened 5 days ago

gabrielwhite commented 5 days ago

Bug Description

I have a recurring meeting that is based on CET/Ceuta that started in July 2024. I live in America/Santiago.

When we changed to daylight savings time here in Chile (a month ago), the event kept being read as being at the old time (i.e. the event was at 9AM America/Santiago before the daylight savings change, and should be at 10AM America/Santiago after the change, but it still shows as 9AM in n8n).

I don't see this problem in any of my calendar apps.

name: n8n
services:
    n8n:
        container_name: n8n
        ports:
            - 5678:5678
        volumes:
            - ./data:/home/node/.n8n
        environment:
            - N8N_EDITOR_BASE_URL=https://n8n
            - GENERIC_TIMEZONE=America/Santiago
            - TZ=America/Santiago
        image: docker.n8n.io/n8nio/n8n
        restart: unless-stopped

Please let me know if I can provide any more debug info.

To Reproduce

  1. Create event with participants in different timezones in north and southern hemisphere / locations that do not share same daylight savings schedule or direction
  2. Wait for daylight savings time to change
  3. See event is showing wrong time in recipients timezone

Expected behavior

Event time should reflect updated local time.

Operating System

Debian Bookworm

n8n Version

1.62.5

Node.js Version

Whatever ships with the docker image

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 5 days ago

Hey @gabrielwhite,

We have created an internal ticket to look into this which we will be tracking as "GHC-320"

Joffcom commented 5 days ago

Hey @gabrielwhite,

Where is the calendar event being created and read from?

gabrielwhite commented 5 days ago

The calendar event is being created in CET (Microsoft Outlook / cloud), and read in America/Santiago (from Google Calendar)

Joffcom commented 5 days ago

Hey @gabrielwhite,

Where is it that you are seeing the wrong date / time? Can you explain what your workflow is doing are you syncing calendars maybe? I can't see which part of this process we would be changing the times at the moment.

gabrielwhite commented 5 days ago

The workflow is being run on an n8n instance in America/Santiago.

The workflow gathers all today's events from three (Google) calendars, merges the list and then produces an email with a daily agenda. So it's only reading and formatting the list.

The calendar event in question shows at the correct time in Google Calendar (set to America/Santiago) but the data that appears in the workflow on n8n for this event shows the wrong time.

The issue only appears on a recurring event that was created before the change in daylight savings time. Events that were sent to me from CET/Ceuta after the daylight savings change are showing as the correct time in n8n.

gabrielwhite commented 5 days ago

Here's the content of the JSON from n8n for this event. The event is at 3PM CET / 10AM America/Santiago.

{
    "kind": "calendar#event",
    "etag": "\"3443465365506000\"",
    "id": "_60q30c1g60o30e1i60o4ac1g60rj8gpl88rj2c1h84s34h5jk34ko30c1g6h1jidq16d14ch9o8h1k8g9g64o30c1g60o30c1g60o30c1g60o32c1g60o30c1g61232dhi6h14ce21lkj345l3k4n6t1j2c9k6p246g9p68rg",
    "status": "confirmed",
    "htmlLink": "redacted",
    "created": "2024-07-23T10:11:59.000Z",
    "updated": "2024-07-23T11:04:42.753Z",
    "summary": "Meeting name",
    "description": "redacted",
    "location": "Microsoft Teams Meeting",
    "creator": {
      "email": "redacted",
      "displayName": "Gabriel White",
      "self": true
    },
    "organizer": {
      "email": "redacted",
      "displayName": "redacted"
    },
    "start": {
      "dateTime": "2024-07-16T09:00:00-04:00",
      "timeZone": "Africa/Ceuta"
    },
    "end": {
      "dateTime": "2024-07-16T09:45:00-04:00",
      "timeZone": "Africa/Ceuta"
    },
    "recurrence": [
      "RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20241217T140000Z;INTERVAL=1;BYDAY=TU"
    ],
    "iCalUID": "040000008200E00074C5B7101A004C97A3BFE8DCDA010000000000000000100000000D1624BF8A262E4884D77C1146DCA927",
    "sequence": 0,
    "attendees": [
        REDACTED
    ],
    "guestsCanInviteOthers": false,
    "privateCopy": true,
    "reminders": {
      "useDefault": true
    },
    "eventType": "default",
    "nextOccurrence": {
      "start": {
        "dateTime": "2024-10-22T12:44:59-03:00",
        "timeZone": "Africa/Ceuta"
      },
      "end": {
        "dateTime": "2024-10-22T13:29:59-03:00",
        "timeZone": "Africa/Ceuta"
      }
    }
  }