JS 获取当前年份

function now(){
var myDate = new Date();
var nowTime = myDate.getFullYear();
document.getElementById("now").innerHTML = nowTime;
}
setInterval("now()",1000);

You may also like...