Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Time counter (In Hours)

  • Time counter (In Hours)

    Posted by Mario Pascal on December 27, 2016 at 10:06 pm

    Well i need an expression that can count the time of the composition in hours I need it to be like this 0:00:00 (Hour,Minutes,Seconds)
    I’ve gotten an expression that can count the time of a comp but when it reaches an hour is shows 60:00 and then continues, and I don’t like it like that.. I want one that will show 1:00:00 when it reaches an hour, please help!

    Mario Pascal replied 9 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 28, 2016 at 12:54 am

    Something like this maybe:


    function padZero(n){
    s = "" + n;
    if (s.length > 1) return s;
    return "0"+s;
    }
    t = Math.floor(time);
    hr = Math.floor(t/3600);
    min = Math.floor((t%3600)/60);
    sec = t%60;
    hr + ":" + padZero(min) + ":" + padZero(sec)

    Dan

  • Mario Pascal

    December 28, 2016 at 5:44 pm

    Thanks alot!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy