Click here to Skip to main content
15,867,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working on a middle ware API that uses Share point 2013 as back end.
Using ListItemCollection.GetByID(id) to update. While updating a date time field with UTC time, the time goes time-5 hours of the time existed in the column , instead of the data I inserted.

But when I call List.GetItemById(id) to get the ListItem to update, it is working fine when updating.

What I have tried:

I have googled it for hours, but unable to find the reason.
Posted
Updated 11-Feb-19 7:13am

1 solution

Pakistan is 5 hours ahead of UTC time.

Perhaps that's an indication of where the problem is: confusion over "local" time versus UTC time.
 
Share this answer
 
Comments
A.R Farooqui 12-Feb-19 0:03am    
Thanks @Gerry for responding..
Yeah i know that Pakistan is 5 hours ahead of UTC time ... That's not the problem, Actually i am giving UTC time ... so no chance of any issue there..

This is some weird behavior of Sharepoint Client context. I did a bit more R&D
(But still unable to find the exact problem thou) on that.. and got that when I call execute query method after ListItemCollection.GetByID(id) its save correct time ... but without that I dont know what is happening.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900