In ActionScript 3.0, is there an automatic way to calculate the number of days, hours, minutes and seconds between two specified dates?
Basicly, what I need is the A
You can covert the two date times into milliseconds since the epoch, perform your math and then use the resultant milliseconds to calculate these higher timespan numbers.
var someDate:Date = new Date(...);
var anotherDate:Date = new Date(...);
var millisecondDifference:int = anotherDate.valueOf() - someDate.valueOf();
var seconds:int = millisecondDifference / 1000;
....
The LiveDocs are useful for this type of thing too. Sorry if the ActionScript is a bit off, but it has been a while.
I'd also recommend creating a set of static class methods that can perform these operations if you're doing a lot of this type of math. Sadly, this basic functionality doesn't really exist in the standard APIs.