js简单显示动态时间点
时间:2014-05-23 03:53:07
收藏:0
阅读:251
<input type="text" id="showtime" redayonly="redayonly" /> <script> function nowGetTime(){ var date=new Date(); document.getElementById("showtime").value=date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds(); } window.setInterval("nowGetTime()",1000); </script>
评论(0)