时间显示js


英文

<script>arr=new Array("Sunday","Monday ","Tuesday","Wednesday","Thursday","Friday","Saturday");setInterval("d=new Date();jnkc.innerHTML=arr[d.getDay()]+'&nbsp;'+d.getYear().toString() +'/'+ (d.getMonth()+1)+'/'+ d.getDate()+'&nbsp;'+d.getHours().toString()+':'+d.getMinutes().toString()+':'+d.getSeconds().toString() ;",1000);</script>

中文

<script>setInterval("jnkc.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);</script>

<div id="jnkc"></div>

你可能感兴趣的:(js)