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: http://blog-sharepoint.blogspot.com/2009/07/infopath-caml-date-time-format-in-when.html


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...