javascript 日期对象

<script type="text/javascript">

var current_time = new Date();

var strDate = current_time.getYear()+"年";

strDate += current_time.getMonth()+"月";

strDate += current_time.getDate()+"日 ";

strDate += current_time.getHours()+":";

strDate += current_time.getMinutes()+":";

strDate += current_time.getSeconds();

alert(strDate);

</script>

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