Page 2 of 2

Re: Countdown Timer Script

PostPosted: 01/7/2012, 7:20 am
by Sinan Karacam
Thx for sharing it with us.

Re: Countdown Timer Script

PostPosted: 12/17/2016, 4:16 am
by lrntbb2
You can use this free tutorial on vdodna's site:

http://www.vdodna.com/tutorials/3-digital-clock/


Or use this Digital Clock / Timer Presets:

http://www.vdodna.com/products/digital- ... r-presets/


Good Luck!

Image

Re: Countdown Timer Script

PostPosted: 12/17/2016, 6:39 am
by Guitarboy2828
After effects has a limit of a 3 hour composition, so, even though you can create an expression that'll create Days, hours, minutes, seconds, you won't be able to create a long enough video. Besides a video that is 72 hours long is going to be HUGE and most computers will struggle to play it, even if it is just a countdown clock.

Anywas, that being said, this script should do what you're after.

Code: Select all
countspeed = 1;
clockStart = 0;

function times(n){
  if (n < 10) return "0" + n else return "" + n
}

clockTime = clockStart +countspeed*(time - inPoint);

if (clockTime < 0){
  minus = "-";
  clockTime = -clockTime;
}else{
  minus = "";
}

t = Math.floor(clockTime);
d = Math.floor(t/86400);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms = clockTime.toFixed(3).substr(-3);
minus + times(d) + ":" + times(h) + ":" + times(min) + ":" + times(sec)