Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Date countdown?

  • Date countdown?

  • John Palaganas

    June 22, 2009 at 12:42 am

    Hey guys,

    Been an avid viewer on the forum and site but finally something I can’t figure out 🙂

    Expressions is not my forte, can you guys point me out on how to do a date countdown by day?

    Let’s say I can start a specific date (August 21, 2029) to countdown to (June 1, 1887).

    So the first thing that countsdown is the day then month then year. Is it very hard?

    Thank you to anyone that can point me to the right direction.
    John

  • John Palaganas

    June 22, 2009 at 12:51 am

    It’s all good, found it! Effects -> Numbers (Format: Long Date)

    Thanks!!!

  • Filip Vandueren

    June 22, 2009 at 6:46 am

    Thankfully, the javascript Date() object works in After Effects:


    monthnames=["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];

    date_1=new Date(2029,7,21); // watchout month 0=januari, 11=:december !
    milli_1=date_1.getTime();

    date_2=new Date(1887,5,1);
    milli_2=date_2.getTime();

    //interpolate from 0 to 5 seconds;
    t=linear(time,0,5,milli_1,milli_2);

    date_3=new Date(t);

    monthnames[date_3.getMonth()] + " " + date_3.getDate() + " " + date_3.getFullYear();

    You’ll probably want to control the interpolation with a slider instead of directly throught time.

  • John Palaganas

    June 22, 2009 at 2:19 pm

    Thanks Filip! Will try this as well!
    John

  • Filip Vandueren

    June 22, 2009 at 5:34 pm

    I can’t get the Numbers thing to work with dates before 12/11/1912, slider=-30000 but this maybe a Mac limitation.

  • Liyana Ghafar

    November 14, 2012 at 2:35 pm

    Hi.
    Im new to this adobe after effects. I want to make date countdown (e.g present date reverse to past date (30/04/2012 –> 25/02/1980) effect). But I dont know how to with this script. Please help. Thnks

  • Dan Ebberts

    November 14, 2012 at 8:18 pm

    Something like this could work:

    startDate = “Apr 30 2012”;
    endDate = “Feb 25 1980”;
    rate = 2; // counts per second

    d1 = new Date(startDate);
    d2 = new Date(endDate);
    msPerDay = 24*60*60*1000;
    t = Math.floor((time-inPoint)*rate);
    ms = Math.max(d1.getTime() – t*msPerDay,d2);
    d = new Date(ms);
    dy = “” + d.getDate();
    mo = “” + (d.getMonth()+1);
    yr = “” + d.getFullYear();
    if (dy.length < 2) dy = “0” + dy;
    if (mo.length < 2) mo = “0” + mo;
    dy + “/” + mo + “/” + yr

    Dan

  • Wiktor Osiecki

    November 25, 2013 at 10:33 pm

    I have to put that script into File > Script > Script Editor or into Numbers effect?

  • Dan Ebberts

    November 25, 2013 at 10:48 pm

    It’s an expression that you would apply to a text layer’s Source Text property.

    Dan

  • Wiktor Osiecki

    November 25, 2013 at 11:05 pm

    It’s working like a charm! Thank You!

Viewing 1 - 10 of 16 posts

Log in to reply.

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