I have a SharePoint 2013 List containing DateTime column field. I read that list items using REST Web-service from Java. In the REST call it gives a Date off by 1 day from the date shows in the list.
For example: List date shows as 7/12/2014 in table. REST XML response result gives "2014-07-11T16:00:00Z".
How to Fix this issue?
This happens, because in SharePoint UI, when you're setting the date field without time, it will assume that you're setting dd-MM-yyyy 00:00:00 of your local time. But in database it will try to adjust the date to Universal Time. And that's what you're getting from REST service.
If you're LocaleId is the same in the browser as it was on the server during saving the date, then simple javascript new Date("2014-07-11T16:00:00Z")
should return right value. If not, then you will have to manually adjust the timezone. Regional settings may be something that can help you. In SP 2013 you can also access it from the REST Api:
http://msdn.microsoft.com/en-us/library/office/jj246227(v=office.15).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With