<script language=Javascript>var now=new Date()document.write(1900+now.getYear()+"-"+(now.getMonth()+1)+"-"+now.getDate()+" "+now.getHours()+":"+n"/>

html中使用js来获取本地系统时间

html中使用js来获取本地系统时间
复制代码
代码如下:

<div id="名称"> 
<script language=Javascript> 
var now=new Date() 
document.write(1900+now.getYear()+"-"+(now.getMonth()+1)+"-"+now.getDate()+" "+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()) 
</script> 
</div> 

推荐阅读