try it by accessing the Date.time property for you math operations.

On Nov 13, 2007, at 12:36 PM, flexawesome wrote:

> Hey, I am working on Comparing the Date, the following code does work
> with declare :*, however I would like to declare to :Date, but it
> doesn't work.
>
> Does anybody know how to declare for dDays and fully handle this?  
> Thanks
>
> ===============
> <?xml version="1.0"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> initialize="init();">
>     <mx:Script>
>         <![CDATA[
>
>         private var Date1:*
>         //private var Date1:Date
>         private var Date2:*
>         //private var Date2:Date
>
>         private function init():void{
>
>
>             // get current year, make date using that with December
> (month=11), day 15
>             Date1 = new Date(2007, 10, 10);
>
>             // get current date.
>             Date2 = new Date();
>
>
>             // convert difference in milliseconds to days
>             var dDays:* = Math.floor((Date2 - Date1)/86400000);
>
>
>             trace(Date1);
>             trace(Date2);
>             trace(dDays);
>
>         }
>
>         ]]>
>     </mx:Script>
> </mx:Application>
> ===============
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>

Reply via email to