0
votes

I'm totally stumped here!

Performing the call isn't an issue, it's what SharePoint is bringing back. I have a list with a DateTime field with real name 'Session_x0020_Date', and one entry is '30/03/2017 17:00'. when I simply query using:

http://[mysite]/_api/web/lists/getbytitle('[mylist]')/items?$Session_x0020_Status=%27Open%27

It returns within the xml - 2017-03-30T16:00:00Z

Other rows return fine, it simply returns one hour less. I've deleted the row and re-entered it, same happens! Is there some gremlin in the works I should know about?

1

1 Answers

0
votes

Its not because of SP. It happens based on TimeZone. To avoid that Change the obtained Date value to the server TimeZone.

function toTimeZone(time, zone) {
var format = 'YYYY/MM/DD HH:mm:ss ZZ';
return moment(time, format).tz(zone).format(format);
}