如何将默认时间显示改成XXXX年XX月XX日?可以按照真实时间自动抓取的
”Mon Mar 21 2016 13:33:36 GMT+0800 (中国标准时间)“如何修改?
2016-03-21
<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系好安全带,准备启航</title>
<script type="text/javascript">
var mydate= new Date();
var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
var mynum=mydate.getDay();
var myyear= mydate.getFullYear();
var mymonth= mydate.getMonth()+1;
var myday= mydate.getDate();
document.write(myyear + "年" + mymonth + "月" + myday + "日 " + weekday[mynum] + "<br>");
</script>
</head>
<body>
</body>
</html>
举报