FORUMS: list search recent posts

Countdown(up) to newyear

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Bas v Breugel
Countdown(up) to newyear
on Dec 19, 2012 at 4:40:29 pm

I am searching the internet for an expression for a text layer to go from 23:50:00 to 23:59:59 (1 second before midnight)

Al the expression i could find are counting down from 10 min to 0 seconds.

Any suggestions? thanks a lot!


Return to posts index


Dan Ebberts
Re: Countdown(up) to newyear
on Dec 19, 2012 at 5:37:28 pm

This should work:

rate = 1;
clockStart = (23*60 + 50)*60;
clockStop = (23*60 + 59)*60 + 59;

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

clockTime = Math.min(clockStart + rate*(time - inPoint),clockStop);

t = Math.floor(clockTime);
hr = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
padZero(hr) + ":" + padZero(min) + ":" + padZero(sec)


Dan



Return to posts index

Bas v Breugel
Re: Countdown(up) to newyear
on Dec 19, 2012 at 5:57:03 pm

Wow Dan, that's exactly what i was looking for! Thank you so much!


Return to posts index


Davis Lindsay
Re: Countdown(up) to newyear
on Dec 19, 2012 at 6:15:27 pm

Hello,

Here's a solution that will get you from 23:50:00 to 24:09:59 using a text layers source text.

You can also use the Text >Timecode Effect if you can handle the default font.
Set your Time Source to custom:
Time Units = 60
Starting Frame = 5148000

fps = (1/thisComp.frameDuration);
spm = 60/fps;
fpm = fps*spm

s = Math.floor(Math.floor(time)%fpm);
m = Math.floor(Math.floor(time)/fpm);

if ((s>9) && (m&lt;10)){
"11"+":"+(50+m)+":"+s
} else if ((s&lt;=9) && (m&lt;10)){
"11"+":"+(50+m)+":0"+s
} else if ((s&lt;=9) && (m>=10)){
"12"+":0"+(m-10)+":0"+s
} else if ((s>9) && (m>=10) && (m&lt;20)){
"12"+":0"+(m-10)+":"+s
}


Prepare for today and you'll survive, prepare for tomorrow and you will thrive.


Return to posts index

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