当我创建一个日期接近的事件时,一切正常。
但是,当我创建几个月后的活动时,假设它属于夏令时DST时(当前我处于夏令时),则该事件的创建会产生不必要的1小时偏移。
以下代码产生以下输出:
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,
);
题
我应该如何更改代码,使其自动运行,而无需每年两次手动更改代码/偏移量?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句