Stop SharePoint to store dates in UTC

Using client JavaScript CSOM, you can set the date and time fields values as you want. There is just a little issue. If you used JavaScript Date object SharePoint will store the date in UTC, not your local time, which might be or not the same or UTC, but probably not.

var dt = new Date();

But don’t worry about this. There is a workaround. You just need to convert the date into an ISO string. On SharePoint, Microsoft Ajax library offers by default a format function for Date object.

var dt = new Date();

Workaround is simple. Nothing complicated in this. In general, I think SharePoint is a great platform for development, if you find the right information.

Leave a Reply

Your email address will not be published. Required fields are marked *