js获取年月日星期代码
2019-04-27 Umming js常用代码 评论(0) 浏览(1645)
<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>
下一篇: js使用指定字符串作为判断条件
本文链接:https://www.umming.com/js/78.html 百度已收录
声明:本站信息由网友自行发布或来源于网络,真实性、合法性由发布人负责,请仔细甄别!本站只为传递信息,我们不做任何双方证明,也不承担任何法律责任。文章内容若侵犯你的权益,请联系本站删除!
也许你还会对下面的内容感兴趣:
发表评论: