5 Replies Latest reply on Jun 25, 2009 7:36 PM by Ned Murphy

    Find time elapsed from Unix Timestamp in Actionscript 2.0




      I'm tryin to fiind the time elapsed from a Unix Timestamp.


      I have this:

           var myTime:Date = new Date(1245859691 * 1000);
           nowTime = new Date();
           oMillisElapsed = new Date(nowTime - myTime);
           day = numToStr(oMillisElapsed.getDate());
           min = numToStr(oMillisElapsed.getMinutes());
           sec = numToStr(oMillisElapsed.getSeconds());
           hour = numToStr(oMillisElapsed.getHours());


      But oMillisElapsed returns: Wed Dec 31 23:20:43 GMT-0800 1969


      So it's still returning the time from 1/1/1970.... Any way to make it return something like this:


      Mon Jan 02 01 1:2:35 GMT-0800 0000


      or something like that so I can get the days, hours, minutes, and seconds elapsed.



      I'm using actionscript 2.0.


      Thank you!!!