Recommand · October 14, 2021 0

Creating All Day event msgraph API

I’m trying to create all-day event with MS Graph API. The issue I’m having is when I create event on outlook it extends the event to the next day, screenshot below:

enter image description here

This is the event body I’m sending:

enter image description here

this is how I’m calculating start and end day:

$eventBody['start'] = array("dateTime" => date('Y-m-d H:i:s', strtotime($row->day_date)), "timeZone" => $timeZone);
    $eventBody['end'] = array("dateTime" => date('Y-m-d H:i:s', strtotime($row->day_date . ' +1 day')), "timeZone" => $timeZone);