Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Google_Service_Calendar Event Date Time

$startDateTime = new Google_Service_Calendar_EventDateTime();
$endDateTime = new Google_Service_Calendar_EventDateTime();

$startDateTime->dateTime = date('c', strtotime(date('2022-02-04 10:30')));
$endDateTime->dateTime = date('c', strtotime(date('2022-02-04 11:30')));

$startDateTime->timeZone = 'America/Montreal';
$endDateTime->timeZone = 'America/Montreal';

// auth process
$googleClient = new Google_Client();
$googleClient->setApplicationName("Google Calendar");
$googleClient->setAuthConfig(CREDENTIALS_PATH);
$googleClient->setScopes([SCOPES]);
$googleClient->setSubject(CALENDAR_ID);
$calendarService = new Google_Service_Calendar($googleClient);

// retrieve event
$eventId = 89;  // some example event id
$createdEvent = $calendarService->events->get(CALENDAR_ID, $eventId);

$createdEvent->setStart($startDateTime);
$createdEvent->setEnd($endDateTime);

$updatedEvent = $calendarService->events->update(
  CALENDAR_ID, 
  $createdEvent->getId(), 
  $createdEvent
);
Comment

PREVIOUS NEXT
Code Example
Php :: redirect back in laravel livewire 
Php :: php right characters 
Php :: for loop php increment by 2 
Php :: collection pluck remove duplicates 
Php :: check if value exists in object php 
Php :: wordpress my account url 
Php :: laravel 8 plural singular 
Php :: php check regular string 
Php :: Internal error: xmlSchemaValidateChildElem, calling xmlRegExecPushString2(). 
Php :: first letter capital of every word in php 
Php :: laravel migration on delete set null 
Php :: php var dump die 
Php :: check if value is not null in db laravel 
Php :: bind multiple data in one id in php using php using for loop 
Php :: post thumbnail 
Php :: how to install redis for php7.4 
Php :: decimal to binary php 
Php :: to paste file in opt/lampp 
Php :: créer projet laravel 
Php :: loop through values of hash php 
Php :: webuzo set upload limit 
Php :: laravel with trashed specific 
Php :: phpmyadmin import size limit 
Php :: migration bool type eloquent orm 
Php :: get base url in magento 2 
Php :: laravel 419 page expired on login 
Php :: laravel join query sum example 
Php :: Laravel 8: seed users + Jetstream teams 
Php :: date 3 months ago for a particular date php 
Php :: php base64 to image 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =