AnsweredAssumed Answered

Setting a date field in a Web Script

Question asked by eg on Mar 7, 2008
I have a custom content type that has a date field defined. When I set the date on the newly created node and then try and save the node I get an error indicating that the value is not compatible with the type defined.

In the code below, n is the node object, "cdi:InDate" is defined as a date type:


n.properties["cdi:InDate"] = new Date().toLocaleString();
n.save();

Should I be setting the date using a different method?

Thanks

Outcomes