When I create an event giving it a near date, all works well.
But when I create an event which is a few months later, say that it falls in outside the daylight saving time period DST (while I am currently in the daylight saving time period), the event is created with an unwanted 1 hour offset.
The code below results in the following output:
Starts 2020-12-20 9:00 Ends 2020-12-20 11:00
$event = array(
'summary' => $attributes['summary'],
'location' => $attributes['location'],
'description' => $attributes['description'],
'start' => array(
'dateTime' => 2020-12-20T10:10:00-04:00',
'timeZone' => 'America/Toronto',
),
'end' => array(
'dateTime' => 2020-12-20T10:12:00-04:00',
'timeZone' => 'America/Toronto',
),
'anyoneCanAddSelf'=>true,
'guestsCanInviteOthers'=>true,
);
Question
How should I change my code so it works automatically and so that I don't need to manually change my code / the offset twice a year?