获取当前本地时间Date
获取当前本地时间JavaScript:
<script type="text/javascript"> var mydate = new Date(); var nian = mydate.getFullYear(); var yue = mydate.getMonth()+1; var ri = mydate.getDate(); var xingqi = mydate.getDay(); switch(xingqi){ case 0: xingqi = "星期日";break; case 1: xingqi = "星期一";break; case 2: xingqi = "星期二";break; case 3: xingqi = "星期三";break; case 4: xingqi = "星期四";break; case 5: xingqi = "星期五";break; case 6: xingqi = "星期六";break; } document.write("今天是"+nian+"年"+yue+"月"+ri+"日 "+xingqi); </script>
网站:http://shibowl.top
github:https://github.com/hanbinjxnc
博客园:https://www.cnblogs.com/hool
博客:https://blog.shibowl.top
淘宝店:https://boxunwl.taobao.com/
作者:世博 2019年4月28日
github:https://github.com/hanbinjxnc
博客园:https://www.cnblogs.com/hool
博客:https://blog.shibowl.top
淘宝店:https://boxunwl.taobao.com/
作者:世博 2019年4月28日