In this example we have created Date class object and pass multiple numeric parameters.
In this example we have created Date class object and pass multiple numeric parameters.Date class with multiple numeric parameters to the Date() constructor example:-
In this example we have created Date class object and pass multiple numeric parameters as the year, month, day, hour, minute, second, and millisecond, respectively, and returns a corresponding Date object. The date class object take time information of the midnight to the related date. This is the example of multiple numeric parameterized constructor of the date class.
Example:-
|
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"xmlns:s=" library://ns.adobe.com/flex/spark"xmlns:mx=" library://ns.adobe.com/flex/mx" creationComplete="init();"> <fx:Script><![CDATA[ mytext.text = (String)(currdate.toDateString()); mytext1.text = (String)(currdate.toLocaleTimeString()); mytext2.text = (String)(currdate.toLocaleString()); } ]]> </fx:Script> <s:Panel width="335" height="130" title="Date Class Panel" backgroundColor="0xE0FFFF"></s:Application> |
In this example we have pass values 2010 for year , 5 for month, 1 for day, 0's for hours, minutes, seconds, and milliseconds. Users note that the month value is starts 0 to11 so the numeric value 5 have corresponding month is June.
Output:-
