1

I'm using oDataFeed to retrieve sharepoint list data and place it in excel sheet. One of the fields in the list is date time field. I have noticed that the date is correct in the list but not on the excel sheet. For example, list shows 2/25/2016 12:00 AM and excel shows 2/24/2016 9:00 PM.

What's the cause of this and how do I fix it?

3
  • What time zone are you in? Commented Feb 29, 2016 at 17:13
  • @DylanCristy GMT +3. I have noticed this pattern too, it adds 3 hours to the actual date. Commented Feb 29, 2016 at 17:14
  • OData has Edm.Date and Edm.DateTimeOffset primitive types. I think you need the second one Commented Feb 29, 2016 at 17:44

1 Answer 1

0

SharePoint stores DateTime values internally as UTC, and corrects it to the local time when displaying through the UI.

If you are in GMT+3, and the values you see from the data feed are consistently three hours behind what you think they should be, it's likely that you are getting the raw UTC values form the data feed, and need to correct for your local offset.

2
  • yes, that was it. I have created an additional column that adds +3 hours to the date to get the correct values. thanks!! Commented Feb 29, 2016 at 17:42
  • This is the correct answer, and this website has the full translation guide for anyone who needs to translate UTC to their time: earthsky.org/astronomy-essentials/universal-time
    – Toby Pior
    Commented Nov 17, 2018 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.