Click here to Skip to main content
13,863,229 members
Rate this:
 
Please Sign up or sign in to vote.
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 8:13am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
   
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190214.1 | Last Updated 11 Feb 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100