Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How to create a 15-minute countdown in After Effects?

  • How to create a 15-minute countdown in After Effects?

    Posted by Thomas Reimer on July 6, 2015 at 6:37 pm

    Hi there,

    I’m fairly new to after effects, and I can’t seem to find a tutorial online to help me create a 15 minute countdown timer in after effects. Any help would be appreciated.

    Thanks!

    Thomas

    Walter Soyka replied 4 years, 10 months ago 5 Members · 6 Replies
  • 6 Replies
  • John Cuevas

    July 6, 2015 at 8:16 pm

    I did a search in the expressions forum and found this countdown timer. Just create a comp 15 minute long. Press “cntl+alt+shift+T” to create a text layer. Copy the entire expression written below. Twirl open the text and “alt + click” the source text stop watch to enable expressions, then paste expression below into the box. Lastly, make sure the text is right justified.

    rate = -1;
    clockStart = 900;

    function padZero(n){
    if (n < 10) return "0" + n else return "" + n } clockTime = Math.max(clockStart + rate*(time - inPoint),0); t = Math.floor(clockTime); min = Math.floor((t%3600)/60); sec = Math.floor(t%60); min + ":" + padZero(sec)

    Johnny Cuevas, Editor
    ThinkCK

    "I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
    ---THOMAS EDISON on inventing the light bulb.

  • Thomas Reimer

    July 7, 2015 at 12:19 pm

    Thank you so much! I have been searching for this expression but finally have found it. Thanks!

  • Trevor Morgan

    August 26, 2021 at 8:46 pm

    Same issue here. Looking to make the 15:00min countdown timer… But in AE 2021 the expression isn’t working.

    Any tips?

    Thanks!

  • Walter Soyka

    August 26, 2021 at 9:50 pm

    Ae updated its Javascript engine a few releases ago, and that came with stricter enforcement of curly braces around blocks in if/else statements.

    Here’s the code above, updated for recent releases of Ae:

    rate = -1;

    clockStart = 900;

    function padZero(n) {

    if (n < 10)

    return "0" + n;

    else {

    return "" + n;

    }

    }

    clockTime = Math.max(clockStart + rate * (time - inPoint), 0);

    t = Math.floor(clockTime);

    min = Math.floor((t % 3600) / 60);

    sec = Math.floor(t % 60);

    min + ":" + padZero(sec)

  • Chip Hess

    August 31, 2021 at 3:38 pm

    This is great. Now if we would want to change the duration to something less or greater than 15 minutes, what would we change? Just the Comp length?

  • Walter Soyka

    August 31, 2021 at 4:02 pm

    Change the clockStart variable, which determines the starting point for the countdown timer in seconds. 900 seconds = 15 minutes * 60 seconds/minute.

    If you wanted a 5 minute countdown, you could do this:

    clockStart = 5 * 60;

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