1 Reply Latest reply on Aug 10, 2010 2:59 AM by Balakrishnan V

    Best Way to Calculate Time

    Kurrykid Level 3

      I am working on an app that will record practice session times.  I am trying to find the best way to document and calculate this information.  For example, if someone set the start time at 10:45PM and ended at 11:47PM, that would be 62 minutes.  I think it will be a little more challenging when crossing over midnight...from 11:30PM to 12:45AM.


      I downloaded "TimeStepper" from Astra-Flex and it seems to have great potential but it says it's for Flex 3 and the time stepper isn't displaying properly in Flash Builder.


      Any suggestions for a solution?  I would prefer a solution where they can change the time with a control as well as typing it in.





        • 1. Re: Best Way to Calculate Time
          Balakrishnan V

          var dateTime1:Date=new Date()




          After the session ends

          var dateTime2:Date=new Date()




          When you do a new Date(), it returns as the time value,


          The number of milliseconds since midnight January 1, 1970, universal time, for a Date object.


          So the difference in the time values of the 2 objects gives the milliseconds between them


          Hope this helps


          Balakrishnan V