-1
次のコードを使用してイベントを作成しましたが、エラーが発生しました。GoogleカレンダーAPI PHP(400)終了時間がありません
$service = new Google_Service_Calendar();
$calendarId = "<some calendar id>";
$startDate = "2017-12-04";
$startTime = "18:00:00";
$endDate = "2017-12-04";
$endTime = "19:00:00";
$tzOffset = "+08";
$newEvent = new Google_Service_Calendar_Event();
$newEvent->setSummary("title");
$newEvent->setLocation("where");
$start = new Google_Service_Calendar_EventDateTime();
$start->setDateTime("{$startDate}T{$startTime}.000{$tzOffset}:00");
$newEvent->setStart($start);
$end = new Google_Service_Calendar_EventDateTime();
$end->setDateTime("{$endDate}T{$endTime}.000{$tzOffset}:00");
$newEvent->setEnd($end);
$newEvent->setDescription("desc");
$result = $service->events->insert($calendarId, $newEvent);
結果は以下のとおりです。
Error calling PUT <some url>: (400) Missing end time.
何が問題なのですか。助けてください。ありがとう!