请问,如何获取本周周一的日期(年-月-日)?

zhaowo_ms 2004-11-24 11:07:16
请问,如何获取本周周一的日期(年-月-日)?
...全文
74 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
vincent_918 2004-11-24
<script language="JavaScript" type="text/JavaScript">
var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
mydate=new Date();
myweekday=mydate.getDay();
mymonth=mydate.getMonth()+1;
myday= mydate.getDate();
myyear= mydate.getYear();
year=(myyear > 200) ? myyear : 1900 + myyear;
if(myweekday == 0)
weekday=" 星期日 ";
else if(myweekday == 1)
weekday=" 星期一 ";
else if(myweekday == 2)
weekday=" 星期二 ";
else if(myweekday == 3)
weekday=" 星期三 ";
else if(myweekday == 4)
weekday=" 星期四 ";
else if(myweekday == 5)
weekday=" 星期五 ";
else if(myweekday == 6)
weekday=" 星期六 ";
document.write(year+"年"+mymonth+"月"+myday+"日 "+weekday);
</script>
回复
zhwb36 2004-11-24
MondayYear = Year(MondayDate)
MondayMonth = Month(MondayDate)
MondayDay = Day(MondayDate)
回复
zhwb36 2004-11-24
theWeekDay = Weekday(Date()) - 1
if theWeekDay = 0 then
theWeekDay = 7
end if

MondayDate = DateAdd("d",1-theWeekDay,Date())
回复
HHH3000 2004-11-24
函数
year(日期参数)
month(日期参数)
day(日期参数)
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-11-24 11:07
社区公告
暂无公告