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>

你可能感兴趣的:(JavaScript,html)