复制代码 代码如下: <BR>$(document).ready(function(){ <BR>function show(){ <BR>var mydate=new Date(); <BR>var str = "" + mydate.getFullYear() + "年"; <BR>str += (mydate.getMonth() + 1) + "月"; <BR>str += mydate.getDate() + "日 <br/>"; <BR>str += mydate.toLocaleTimeString(); <BR>str += ":" + mydate.toLocaleTimeString(); <BR>str += ":" + mydate.getMilliseconds() + " <br/>星期"; <BR>str += "天一二三四五六".charAt(mydate.getDay()) + "<br/>今年是闰年吗?:"; <BR>str += ((mydate.getFullYear() % 4 == 0 && mydate.getFullYear() % 100 != 0) || (mydate.getFullYear() % 400 == 0)) ? "是" : "不是"; }; <BR>function flush(){ <BR>$("#btnShow").click(show); <BR>} <BR>setInterval(show,1000); <BR>}); <br><br> html代码: 复制代码 代码如下: 显示日期操作 结果: