ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Time counter (In Hours)

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mario Pascal
Time counter (In Hours)
on Dec 27, 2016 at 10:06:16 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!


Return to posts index

Dan Ebberts
Re: Time counter (In Hours)
on Dec 28, 2016 at 12:54:38 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



Return to posts index

Mario Pascal
Re: Time counter (In Hours)
on Dec 28, 2016 at 5:44:12 pm

Thanks alot!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]