Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
LEK0621 #1
Math opreation with DATE
hi, anyone hav idea how can i do math operation with date in flash?
LEK0621 Guest
-
math problem will Math.floor help
I have the following code that at first sight should return a value of zero but does not always. What can be done about this. The following code... -
Math::GMP tests and Crypt::Random fail on Compaq (Math::Pari related ??)
Hi, I've been compiling Math::GMP for different OS's in order to use Net::SFTP and I have successfully compiled and used it for Solaris,... -
Date Math
In MySQL/PHP I convert a MySQL date from a query and just do not know the syntax to add say "1 month" to this date ... <?php echo... -
HELP! Needed with Fox Pro date math
I am accessing a Fox Pro database through ODBC in ASP. I have a table with two dates in it. A start date and an end date. I need to create a... -
OT: Math help
Just divide the width of the page by 2. Then divide the width of the image by 2. Then subtract the length of half of the image from the length of... -
Ivan Peters #2
Re: Math opreation with DATE
"LEK0621" <webforumsuser@macromedia.com> wrote
Depends what sort of calculations you are looking to do.> hi, anyone hav idea how can i do math operation with date in flash?
For example, to increase a date object by a certain number of months you
might do this:
dt.setMonth(dt.getMonth() + 30);
Or, to add a number of days you might do this:
dt.setDate(dt.getDate() + 100);
Doing maths of a date object will convert the object into a value in
milliseconds (as if you did Date.getTime() - which you really should to
avoid confusion). So,
var d:Number = dt1 - dt2;
or
var d:Number = dt1.getTime() - dt2.getTime();
will return the difference between the two dates in milliseconds.
another way of incrementing a date might be:
var d:Number = dt.getTime() + (1000 * 60 * 60 * 24);
dt.setTime(d);
That should give you enough to think about.
Ivan
Ivan Peters Guest



Reply With Quote

