年月日星期js代码
<span id="todayWeek"></span>
<script type="text/javascript" charset="utf-8"> var week = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]; var localToday = ''; var d = new Date(); var localToday = d.getFullYear() + "年" + (d.getMonth() + 1) + "月" + d.getDate() + "日"; document.getElementById('todayWeek').innerHTML = "今日:" + localToday + " " + week[d.getDay()]; </script>