Certified for SharePoint 2007 Certified for SharePoint 2010


This utility function converts a JavaScript date object to the ISO 8601 format required by SharePoint to update list items.


   dateToConvert: new Date(),
   dateOffset: "-05:00"


var thisDate = $().SPServices.SPConvertDateToISO();

Available Options

The JavaScript date we'd like to convert. If no date is passed, the function returns the current date/time.

The time zone offset requested. Default is EST.


A string date in ISO format, e.g., "2013-05-08T01:20:29Z-05:00".

Last edited May 8, 2013 at 5:21 AM by sympmarc, version 3


ptrk_dev Jan 21, 2015 at 8:28 AM 

I want to pass a custom date. How do I have to do that (Example)?

Kind regards,

MichaelWuu Oct 1, 2014 at 12:13 PM 
There is an error in this function:
"2013-05-08T01:20:29Z" - means that this is a UTC timezone.
When You add -05:00 to the UTC date - it is not valid - the Z should be removed thus this is wrong:
This is right:

thamera Oct 28, 2013 at 5:00 PM 
I just found in 2013 that if I place this ISO date format into a form field of an item edit form, I get an error about date format. I can write my own utility but would be nice if this utility had an option to convert an ISO date back to standard format. (In my case, I can't use "UpdateListItem" as I am using getlistitem to get a date value, run some calcs on that date, and place into an item form for a different record so I need it in the accepted format for an item form.)

ptavares May 12, 2013 at 4:21 PM 
Just noticed this method... Nice.. I included a similar one in SPWidgets.