Google Calendar API date time

后端 未结 1 588
情深已故
情深已故 2021-01-14 15:29

I\'m trying to get the Google Calendar Api to work. Without the use of my $_POST date times it works perfect. But then the date is hard coded like the google ones and that i

1条回答
  •  一整个雨季
    2021-01-14 16:33

    Looking at the Google Calendar API docs the required format must follow the RFC 3339 format. To convert a DateTime to this format one can use the DateTime::format function in conjunction with the DateTime::RFC3339 constant.

    You should get something like:

    $dt = new \DateTime();
    $calendarDateTime = new \Google_Service_Calendar_EventDateTime();
    $calendarDateTime->setDateTime($dt->format(\DateTime::RFC3339));
    

    0 讨论(0)
提交回复
热议问题