JS显示当前日期

时间: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("&nbsp;");
document.write(day);
document.write("</span>");
</script>

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章