SPConvertDateToISO

Function

$().SPServices.SPConvertDateToISO

Certification

SharePoint 2007: certified SharePoint 2010: certified

Functionality

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

Syntax

$().SPServices.SPConvertDateToISO({
   dateToConvert: new Date(),
   dateOffset: "-05:00"
});

dateToConvert

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

dateOffset

The time zone offset requested. Default is EST.

Returns

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

Example

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

Back to top