js 显示当前时间

<script>setInterval("LabDayTime.innerHTML=(new   Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay())).substr(0,24);",1000);</script><asp:Label ID="LabDayTime" runat="server"></asp:Label>

 

 

 

<td height="31"><script language="javascript">
function showTime(){
var oDiv = document.all('oDiv');
var oDate = new Date();
var strTime = oDate.getFullYear() + '年' + eval(oDate.getMonth()+1) + '月' + oDate.getDate() + '日  星期' + '日一二三四五六'.substr(oDate.getDay(),1) + '  ' + oDate.getHours() + ':' + oDate.getMinutes() + ':' + oDate.getSeconds();
oDiv.innerHTML = strTime;
window.setTimeout('showTime()', 1000);
}
window.onload = showTime;
</script>
<div id="oDiv"></div></td>

你可能感兴趣的:(当前时间)