After Effects: Tutorial | How to create a digital timer / clock / countdown

preview_player
Показать описание
Expression in the pinned comment.

Thanks for watching and all the best!
Рекомендации по теме
Комментарии
Автор

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);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms =
minus + times(h) + ":" + times(min) + ":" + times(sec) + "." + ms

JellybeanDrugCrew
Автор

If any of you want a timer which is like this 00:00
Minutes:Seconds
Here is the code.

countspeed = 1;
clockStart = 0;

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

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

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

t = Math.floor(clockTime);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
minus +"0" +min +":" +times(sec)

If you want a timer which is like this 0:00
Minutes:Seconds
Here is the code.

countspeed = 1;
clockStart = 0;

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

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

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

t = Math.floor(clockTime);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
minus +min +":" +times(sec)

I hope this is helpful :)

HKR_WRITES
Автор

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);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms =
minus + times(h) + ":" + times(min) + ":" + times(sec) + "." + ms

Oblante
Автор

Spent the last 3 hours trying to find a way to alter the counter as I only wanted minutes and seconds on the timer. First time I'm doing After Effects and I got totally frustrated. Then found your tutorial and it worked perfectly fine with the supplied expression! Brilliant. Cheers mate!

SmoothMotionLtd
Автор

Had to make a demo video for a client with a countdown timer on their site, your script saved me time thank you sir!

lauradaisy
Автор

Seriously dude you are totally my hero. It makes sense that this is one of the only video I've ever seen with zero down thumbs!
You ROCK!

MarkTreen
Автор

Most helpful digital clock tutorial! Thanks!!!

VanezaVargas
Автор

Thanks for the expression. I have been searching for a while to make a timer and you have finally helped me find the answer.

gilisce
Автор

Simplest and best timer expression I have seen so far. Thanks bro!

jjoshuaa
Автор

Thanks for all the positive feedback on this video. Good luck with AE!

AimlessRanger
Автор

Great tutorial and expression. Saved me a headache in after effects and it works marvelously.

mudersville
Автор

Excellent tutorial; thank you!
One QUESTION: Instead of millisecond, is there a way to show hundredths of seconds, or tenths of seconds? Thanks!

paginab
Автор

Very useful. Linked script is not working any more, but here it is:

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);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms =
minus + times(h) + ":" + times(min) + ":" + times(sec) + ":" + ms

MichalMak
Автор

Thanks for this, quick question. Is it possible to have the counter reset to 00:00 after 23:59, I'm doing a through the night time-lapse and this would be perfect if it was possible to do the above. Many thanks.

cmpix
Автор

Great videos with lot's of info! Thanks for posting.

ojatro
Автор

It's the first time I see Adobe After Effects code but I understand it really easily because I can program in PHP :p
Thanks for this video :D

LazyMasterGamer
Автор

You can just add another text layer with either am or pm and move it behind the timer.
Just play around with the expression until it fits :)
If you are unsure about anything just leave me a comment.

AimlessRanger
Автор

Best tutorial I have found, thank you!

-Belshazzar-
Автор

Thanks for this highly professional and extremely helpful guide!

doviyellin
Автор

Amazing, thank you!!! How can I change to just 2 number in the milliseconds??

carmeladomenech
visit shbcf.ru