- <script language="javascript">
d=new Date();
date=d.getDate();
month=d.getMonth()+1;
year=d.getYear();
document.write(date);
</script>
/
<script language="javascript">
d=new Date();
date=d.getDate();
month=d.getMonth()+1;
year=d.getYear();
document.write(month);
</script>
上面是20/1 样式
下面是星期几
下面是星期几
- <script language="javascript">
d=new Date();
date=d.getDate();
month=d.getMonth()+1;
year=d.getYear();
if(d.getDay()==5) document.write("周五")
if(d.getDay()==6) document.write("周六")
if(d.getDay()==0) document.write("周天")
if(d.getDay()==1) document.write("周一")
if(d.getDay()==2) document.write("周二")
if(d.getDay()==3) document.write("周三")
if(d.getDay()==4) document.write("周四")
</script>