Does anyone know how to get actionscript to render a null date value '000:00:00T00:00:00'? I am calling a web service that expects date fields in the SOAP xml. I need some of these dates to serialize as null and开发者_C百科 I can't see how to produce null. The closest value I can get is '1899-11-30T00:00:00Z'. Below is the code I am using:
var dateStr:String = "0000-00-00T00:00:00+"; var emptyDate:Date = DateUtil.parseW3CDTF(dateStr); newReqData.DateTimeInit = emptyDate;
You can probably do it with a date formatter. You'll have to create a Date object but if you pass it to the DateFormatter, you can set the format to pretty much whatever you like. Here's the reference and I would recommend looking at the "Other Text" area:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/formatters/DateFormatter.html
var d:Date=new Date(); d.setTime(-62167226400000); Alert.show(d.toString());
or as said Shawn Yale, read this.
精彩评论