Share via


SharePoint online custom list saving date 1 day off (before)

Question

Thursday, April 26, 2018 9:51 AM

Hello.

I am saving dates in custom SharePoint list (office 365) using my custom form with Jquery date picker.

When i am saving data, then in my list date is saving 1 day before...

i.e. if i am selecting date 25/04/2018 from date picker and saving, then in list it is saving 24/04/2018.

What i can do for this issue ?

Please suggest.

Thanks.

anuj

All replies (3)

Tuesday, May 1, 2018 1:51 AM | 1 vote

Hi anuj,

How did you customize the form? Please post your code with us, so we can try to reproduce your issue.

Best regards,

Grace Wang

Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].


Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.


Wednesday, May 2, 2018 12:57 PM

Maybe the tenant time zone you selected is out? Is this happening on anything else (maybe you've just not noticed) 

If this is helpful please mark it so. Also if this solved your problem mark as answer.


Wednesday, May 2, 2018 3:29 PM

Sharepoint internally stores all dates in UTC - but shows them according to local time zone which is set for current web site (Site settings > Regional settings > Time zone). So when you pass local datetime Sharepoint internally converts it to UTC using server's time zone. In your case server time zone may differ from local user time zone and it causes the problem. Try to convert local datetime on client side to server's time zone before to store it to list item:

Get Sharepoint current datetime in javascript for Sharepoint Online

How to get current server datetime through JavaScript REST

Blog - http://sadomovalex.blogspot.com
Dynamic CAML queries via C# - https://github.com/sadomovalex/camlex