Posted by: Yogesh Puri on: September 9, 2008
The Date class constructor is documented with the following parameters in Adobe Docs
Date(yearOrTimevalue:Object, month:Number, date:Number = 1, hour:Number = 0, minute:Number = 0, second:Number = 0, millisecond:Number = 0)
However today i just tried out and found that there is also a undocumented calling of Date constructor with a Date in a string format. I have tried to pass the date as a string and it converts the Date into a actual Date object of AS3 and you can access all the properties of it.
Following is the statement with a Date Constructor as an input with String parameter
trace(new Date("6/13/2008 8:18:15 AM"));
Keep in mind this doesn’t work with a MySQL now(), which has dashes instead of slashes. This only works with a US formatted date.
September 9, 2008 at 10:38 am
Actually it is the help:
If you pass one argument of data type String, and the string contains a valid date, the Date object contains a time value based on that date.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Date.html#Date()