时间:2021-05-02
日期
<script language="JavaScript" class="unnamed1">
var enabled = 0;
today = new Date();
var day;
var date;
if(today.getDay()==0) day = "星期日"
if(today.getDay()==1) day = "星期一"
if(today.getDay()==2) day = "星期二"
if(today.getDay()==3) day = "星期三"
if(today.getDay()==4) day = "星期四"
if(today.getDay()==5) day = "星期五"
if(today.getDay()==6) day = "星期六"
date=(today.getYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日";
document.write("<span style="font-size:12px;" >");
document.write(date);
document.write(" ");
document.write(day);
document.write("</span>");
</script>
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
JavaScript获取当前日期时间同时显示星期几,具体代码如下:functioncurrentTime(){vard=newDate(),str='';str
JS显示当前日期复制代码代码如下:vardatelocalweek=newArray("星期日","星期一","星期二","星期三","星期四","星期五","
1.显示日期代码:Js代码functiongetCurrentDateTime(){vard=newDate();varyear=d.get
1、js获取当前日期(yyyy-mm-dd)以下代码是获取到的当前日期:varmyDate=newDate();varyear=myDate.getFullYe
Js代码复制代码代码如下:/***获取本周、本季度、本月、上月的开端日期、停止日期*/varnow=newDate();//当前日期varnowDayOfWee