This project has moved. For the latest updates, please go here.

UpdateListItem - How to format date?

Jan 17, 2011 at 11:34 AM


How can I take the local computers time and convert it to a string that UpdateListItem accepts? I know it should be in some UTC format, but can't figure out how to do it.


  	    var clientTime = new Date();
	    var timeToSet = clientTime; // How to format this???????
			operation: "UpdateListItems",
			listName: "SRD",
			ID: 2,
			valuepairs: [["Progress", progress],[DateTimeField1, timeToSet ]],
			completefunc: function (xData, Status) {
				var out = $().SPServices.SPDebugXMLHttpResult({
					node: xData.responseXML,
					outputId: "debugresponse"

Thanks for any help?

Jan 17, 2011 at 12:40 PM

Hi, answering my own question, this was really not a SPSercvices related question sorry for that.

Anyway, here is the answer:


Jan 17, 2011 at 1:27 PM

Glad you got it sorted. Date/time stuff is *always* harder than it seems like it should be. Whoever decided that mixing bases was a good idea...