title: Google-Calendar-Api Error in PHP, "Start and end times must either both be date or both be dateTime"
body: <p>I'm trying to update an event in a google calendar, i'm using the google calendar api, but when i'm trying to set the Start DateTime and the End DateTime of the event i'm getting this error: </p>
  
  <pre><code> "code": 400, "message": "Start and end times must either both be date or both be dateTime." .
  </code></pre>
  
  <p>I've actually tried to format my date to ISO8601 and RF3339 but i'll get different type of errors where the format of the date was not valid</p>
  
  <p>This is my code</p>
  
  <pre><code>$service = new Google_Service_Calendar($client);
    $event = $service-&gt;events-&gt;get($calendarID, $eventId);
  
  $string_start_date ="12-07-2020 07:13:00"
    $start_date = new DateTime($string_start_date);
      $google_start_time = new Google_Service_calendar_eventDateTime();
        $google_start_time-&gt;setDateTime($start_date);
  
  $string_end_date = "13-07-2020 12:00:00";
    $end_date = new DateTime($string_end_date);
      $google_end_time = new Google_Service_calendar_eventDateTime();
        $google_end_time-&gt;setDateTime($end_date);
  
  $event-&gt;setDescription("description");
  $event-&gt;setEnd($google_end_time);
  $event-&gt;setStart($google_start_time);
  $event-&gt;setSummary("summary");
  
  $update = $service-&gt;events-&gt;update($calendarID, $eventId, $event);
  </code></pre>
  
  <p>and this is the content of my two google_service_calendar_eventDateTime objects:</p>
  
  <p>1:<code>object(Google_Service_Calendar_EventDateTime)#31 (6) { ["date"]=&gt; NULL ["dateTime"]=&gt; object(DateTime)#52 (3) { ["date"]=&gt; string(26) "2020-07-12 07:13:00.000000" ["timezone_type"]=&gt; int(3) ["timezone"]=&gt; string(13) "Europe/Berlin" } ["timeZone"]=&gt; NULL ["internal_gapi_mappings":protected]=&gt; array(0) { } ["modelData":protected]=&gt; array(0) { } ["processed":protected]=&gt; array(0) { } }</code></p>
  
  <p>2:<code>object(Google_Service_Calendar_EventDateTime)#58 (6) { ["date"]=&gt; NULL ["dateTime"]=&gt; object(DateTime)#73 (3) { ["date"]=&gt; string(26) "2020-07-13 12:00:00.000000" ["timezone_type"]=&gt; int(3) ["timezone"]=&gt; string(13) "Europe/Berlin" } ["timeZone"]=&gt; NULL ["internal_gapi_mappings":protected]=&gt; array(0) { } ["modelData":protected]=&gt; array(0) { } ["processed":protected]=&gt; array(0) { } }</code></p>