當(dāng)我創(chuàng)建一個活動并給出一個臨近的日期時,一切都運行良好。但是,當(dāng)我創(chuàng)建幾個月后的事件時,假設(shè)它處于夏令時 DST 之外(而我當(dāng)前處于夏令時期間),則創(chuàng)建該事件時會出現(xiàn)不需要的 1 小時偏移。下面的代碼產(chǎn)生以下輸出: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, );問題我應(yīng)該如何更改我的代碼,以便它自動工作,這樣我就不需要每年兩次手動更改我的代碼/偏移量?
Google Calendar API時區(qū)夏令時和標準時間問題
長風(fēng)秋雁
2023-09-22 17:51:58