0 Replies Latest reply on Aug 17, 2015 11:52 AM by adolfj84385943

    convert seconds to standard timer string ?!

    adolfj84385943

      hey  i found this to convert second to standard time (00:00)

       

      but they doesnt work

       

      http://snipplr.com/view/33913/

       

      http://snipplr.com/view/65185/milliseconds-to-mmssmmmm/

       

      can you help me please ?

      its on click event

      [code]

      function convertTime(secs:Number):String

      {

          var h:Number=Math.floor(secs/3600);

          var m:Number=Math.floor((secs%3600)/60);

          var s:Number=Math.floor((secs%3600)%60);

          return(h==0?"":(h<10?"0"+h.toString()+":":h.toString()+":"))+(m<10?"0"+m.toString():m.toS tring())+":"+(s<10?"0"+s.toString():s.toString());

      }

      var counter = sym.getPosition(); // its return 5000

      var mytime=toTimeCode(counter);

      sym.$("Text").html(mytime);

      [/code]