10 Replies Latest reply on Dec 5, 2007 7:53 AM by _noClue();

    Displaying earlier time / date values ( eg. 15 minutes ago )

    _noClue();
      In Actionscript 2, I know how to reference the current date and time, but I'm looking for a way to show what the time was (for example) 15 minutes ago.

      I thought this would be easy initially until I thought, what happens if now was 10 minutes past midnight on the 1st January 2008 ? 15 minutes ago would be 11:55 on the 31st December 2007.

      I guess I could write lots of if statements to determine if the minutes were <0 or if it crossed over to a previous day, or how many days there were in the previous month (is it a leap year) etc... but I'm wondering if there is an easier way to reference 15 minutes ago.

      Thanks