首页 > 代码库 > js简单显示动态时间点

js简单显示动态时间点

<input type="text" id="showtime" redayonly="redayonly" /> 
<script>
function nowGetTime(){
      var date=new Date();
      document.getElementById("showtime").value=http://www.mamicode.com/date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
}
window.setInterval("nowGetTime()",1000);
</script>