-
Clock Expression adapting Dan Ebberts code
hello,
ive been trying to use different versions of Dan Ebberts clock expression but cant seem to get what I need. Please help.
I need 12-hour time, starting at a specific time, ending at a specific time. example 7:34:24 am and ending 11:41:24 pm
im currently using this with a slider, to get the start and end time
—-
rate = 0;
clockStart = effect(“Slider Control”)(“Slider”);function padZero(n){
if (n < 10) return “0” + n else return “” + n
}clockTime = clockStart + rate*(time – inPoint);
if (clockTime < 0){
sign = “-“;
clockTime = -clockTime;
}else{
sign = “”;
}t = Math.floor(clockTime);
hr = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms = clockTime.toFixed(3).substr(-3);
sign + padZero(hr) + “:” + padZero(min) + “:” + padZero(sec)—–
and the slider moves between the time codes. The time needs to speed up and slow down so I have keyframed this with the slider. I add the am and pm manually.
The problem im having is its 24 time. i need this code as 12-hour time.
Can someone help?
Thanks in advance, j