日期:2014-05-16  浏览次数:20352 次

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>