Football Clock
Hi (again) - After Effects CS6
I need to create a clock in After Effects that runs the whole length of a football match (45 mins each half).
Looking at code in a template I brought - I have this expression:
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 = clockTime.toFixed(3).substr(-3);
times(min) + ":" + times(sec) + ""
Now I worked out that by changing the 'clockStart = 0;' to = 2700, I have a 2nd half which starts at 45 mins, which is what I want.
But is there a way to show that when a match gets to 45 mins (or 90 mins in 2nd half) that instead of it going to 45.01.... it shows 45.00 +0.01, 45.00 +0.02 (as technically 46.00 is in the 2nd half)
Thanks for looking and any potential help you can provide
Lee
