当前位置: 技术问答>java相关
设置一周从周一或者周日开始?
来源: 互联网 发布时间:2015-10-28
本文导语: 应该怎么设置,我忘了函数?请帮帮忙 | now = new Date(); weekVal = now.getDay(); ...
应该怎么设置,我忘了函数?请帮帮忙
|
now = new Date();
weekVal = now.getDay();
if (weekVal==0)
msg1="星期日";
else if (weekVal==1)
msg1="星期一";
else if (weekVal==2)
msg1="星期二";
else if (weekVal==3)
msg1="星期三";
else if (weekVal==4)
msg1="星期四";
else if (weekVal==5)
msg1="星期五";
else if (weekVal==6)
msg1="星期六";
看看试不是这样!
weekVal = now.getDay();
if (weekVal==0)
msg1="星期日";
else if (weekVal==1)
msg1="星期一";
else if (weekVal==2)
msg1="星期二";
else if (weekVal==3)
msg1="星期三";
else if (weekVal==4)
msg1="星期四";
else if (weekVal==5)
msg1="星期五";
else if (weekVal==6)
msg1="星期六";
看看试不是这样!