Sample code
The date after date can be changed to the online date of the website
function getRuntime() {
window.setTimeout("show_runtime()", 1000);
X = new Date("9/6/2019 10:00:00");
Y = new Date();
T = (Y.getTime()-X.getTime());
M = 24 * 60 * 60 * 1000;
a = T / M;
A = Math.floor(a);
b = (a-A) * 24;
B = Math.floor(b);
c = (b-B) * 60;
C = Math.floor((b-B) * 60);
D = Math.floor((c-C) * 60);
return "Currently running: "+ A + "day" + B + "hour" + C + "minute" + D + "second"
}
getRuntime();
Post comment 取消回复