javasccript怎么把当前时间打印成中文
<html>
<head>
<script type="text/javascript">
var myDate = new Date();
var year = myDate.getFullYear();
var month = myDate.getMonth() + 1;
var date = myDate.getDate();
var hours = myDate.getHours();
var minutes = myDate.getMinutes();
var seconds = myDate.getSeconds();
//月份的显示为两位数字如09月
if(month < 10 ){
month = "0" + month;
}
if(date < 10 ){
date = "0" + date;
}
//时间拼接
var dateTime = year + "年" + month + "月" + date + "日" + hours + "时" + minutes + "分" + seconds + "秒";
document.write(dateTime);//打印当前时间
</script>
</head>
<body>
</body>
</html>