1 Reply Latest reply on Sep 21, 2010 5:53 AM by Anitha Selvaraj

    Calculate age from a specified time

    samschauhan

      I need to calculate the age based upon the time specified.

       

      E.g.

       

      Suppose time specified is:

       

      3605000 millisecinds

       

      It should return an age of : 1 Hour 5 seconds.

       

       

      Was wondering if anyone can help me here.

       

      Thanks,

      SAM

        • 1. Re: Calculate age from a specified time
          Anitha Selvaraj

          Use the date object to convert it to hours, seconds and milliseconds.

           

          For eg:

          if 3605000 is the milliseconds,

           

          var date:Date = new Date(null,0,0,0,0,0,3605000);

          Alert.show(date.getHours() + ":" + date.getMinutes()+ ":" + date.getSeconds()+":"+date.getMilliseconds());

           

          the above code will give you the number of hours, minutes, seconds and milliseconds.

           

          Regards,

          Anitha