用PHP更新Google日历事件时区
我必须在api文档中遗漏一些东西,我如何通过api请求更新Google事件时区用PHP更新Google日历事件时区,php,google-api,google-calendar-api,Php,Google Api,Google Calendar Api,我必须在api文档中遗漏一些东西,我如何通过api请求更新Google事件时区 $service = new Google_Service_Calendar($client); $event = $service->events->get($calendarId, $eventId); $event->setSummary($summary); $service->events->update($calendarId, $event->getId(),
$service = new Google_Service_Calendar($client);
$event = $service->events->get($calendarId, $eventId);
$event->setSummary($summary);
$service->events->update($calendarId, $event->getId(), $event);
$start = new Google_Service_Calendar_EventDateTime();
$start->setDateTime($dateTimeStr);
$event->setStart($start);
$event->setTimezone('America/Los_Angeles');
错误消息:
试图调用类“Google\u Service\u Calendar\u Event”中名为“setTimezone”的未定义方法。(500内部服务器错误)
您必须在日历上设置时区。不要把它放在活动上 请参见中的示例: 你试过了吗?
$calendar = $service->calendars->get('primary');
$calendar->setTimeZone('America/Los_Angeles');
$updatedCalendar = $service->calendars->update('primary', $calendar);