separator = ":" // offset startH = 21; startM = 19; startS = 20; startF = 02; // calculate current time in H:M:S:F format framesPerSec = 1/thisComp.frameDuration; F = Math.round((time % 1) * framesPerSec); timeRemainder = Math.floor(time); S = timeRemainder % 60; timeRemainder = timeRemainder - S; timeRemainder = timeRemainder / 60; M = timeRemainder % 60; timeRemainder = timeRemainder - M; timeRemainder = timeRemainder / 60; H = timeRemainder; // there's no handling if H > 24... // add offset F = F + startF S = S + startS M = M + startM H = H + startH // check overflowing if (F >= framesPerSec) { F = F - framesPerSec; S = S + 1; } if (S >= 60) { S = S - 60; M = M + 1; } if (M >= 60) { M = M - 60; H = H + 1; } // add "0" to the beginning of the number if it is smaller than 10 StrF = (F < 10 ? "0" : "") + F; StrS = (S < 10 ? "0" : "") + S; StrM = (M < 10 ? "0" : "") + M; StrH = (H < 10 ? "0" : "") + H; "" + StrH + separator + StrM + separator + StrS + separator + StrF