[flexcoders] Date range calculation in ActionScript - need help

2006-02-15 Thread KOT_MATPOC
Hi everyone. I need to display to dates in my application.
One is a current date, which is easily achieved by new Date().
Another date has to be let's say 24 hours earlier. In Java I would 
approach this task converting current date to millis and then 
subtructing from it millis that represent 24 hours and create a new 
date.
In ActionScript Date.getMilliseconds() function seems to return 
milliseconds of the current time.
So, my question is - is that possible to calculate 24 hour earlier date 
from the current date in ActionScript???

Thanks a lot!








--
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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] Date range calculation in ActionScript - need help

2006-02-15 Thread Dekayd Media Inc.
Var tempDate:Date = new Date();
Var tempNumber:Number = tempDate.getTime();
Var twentyFourHoursAgo:Number = tempNumber - 8640;//-millisecond/24Hours
Var newDate:Date = new Date();
newDate.setTime(twentyFourHoursAgo);



-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of KOT_MATPOC
Sent: Wednesday, February 15, 2006 2:59 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Date range calculation in ActionScript - need help

Hi everyone. I need to display to dates in my application.
One is a current date, which is easily achieved by new Date().
Another date has to be let's say 24 hours earlier. In Java I would 
approach this task converting current date to millis and then 
subtructing from it millis that represent 24 hours and create a new 
date.
In ActionScript Date.getMilliseconds() function seems to return 
milliseconds of the current time.
So, my question is - is that possible to calculate 24 hour earlier date 
from the current date in ActionScript???

Thanks a lot!








--
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



 




--
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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/