javascript 日期对象

来源:互联网 发布:有什么软件像初页 编辑:程序博客网 时间:2024/06/07 03:34

<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>