js获取当前时间
function today() { var date = new Date(); var day = date.getDay(); if(day == 0) { day = "日"; } var today = "现在是:" + (date.getFullYear()) + "年" + (date.getMonth() + 1) + "月" + date.getDate() + "日" + "星期" + day + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); document.getElementById("today").innerHTML = today; }
代码片段
<body onload="today();"> <font id="today"></font> <bady>
珍惜现在,珍惜每一分,每一秒。
从不放弃,坚持。。。。。