当前位置: 代码迷 >> JavaScript >> JavaScript获取目前系统时间
  详细解决方案

JavaScript获取目前系统时间

热度:272   发布时间:2012-07-22 19:31:17.0
JavaScript获取当前系统时间

?

<script type="text/javascript">
var now = new Date();
var year = now.getYear();
var month =now.getMonth()+1;
var day = now.getDate();
var hour = now.getHours();
var minute  = now.getMinutes();
var second = now.getSeconds();
alert(year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second);
</script>
  相关解决方案