DateTime Conversion Issues in O365 REST API

In a calendar event,  if the 'All Day Event' toggle is set to true - then the REST API query will return the event Start Date (EventDate) and End Date as UTC.  If the toggle is set to false, then it will return those dates with the local time zone offset (see images below). This complicates the query significantly, and is rather un-intuitive. 



  • Edited by Tracy'S Saturday, August 22, 2015 1:43 AM
August 22nd, 2015 1:03am

Hi,

As a workaround, check whether the "fAllDayEvent" value is false, then use the following URI to convert the data to local time.

http://<sitecollection>/<site>/_api/web/RegionalSettings/TimeZones(timzoneid)/utcToLocalTime(date)

Example:

https://xxx.sharepoint.com/sites/dennis/_api/web/RegionalSettings/timeZone/utcToLocalTime('2015-08-17T06:00:00Z')

More information:

http://www.malindesilva.net/2015/08/sharepoint-datetime-field-rest-api-time.html

https://msdn.microsoft.com/EN-US/library/office/jj245318.aspx

Best Regards,

Dennis Guo

Free Windows Admin Tool Kit Click here and download it now
August 24th, 2015 3:21am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics