<center>
<b>使用JavaScript显示当前日期及时间</b><p></p>
</center>
<script type="text/javascript" language="javascript">
var current_time=new Date();
with(current_time){
var strDate="现在是:";
strDate += getFullYear()+"年";
strDate += (getMonth()+1)+"月";
strDate += getDate()+"日";
strDate += getHours()+":";
strDate += getMinutes()+":";
strDate += getSeconds();
document.write(strDate);
}
</script>
效果图: