万年历

function a(){
c=new Date();
n=c.getFullYear();
y=c.getMonth()+1;
r=c.getDate();
x=c.getDay();
h=c.getHours();
m=c.getMinutes();
x=n+"年"+y+"月"+r+"日"+","+"星期"+x+","+h+":"+m;
alert(x);
}

window.setInterval(a,2000);

原文地址:https://www.cnblogs.com/m110/p/7603993.html