<%'每天是星期几
Function DayWeek(Yeari,Monthi,Dayi)
Dim Days
Days=0
Dim yi,mi
'年
For yi=2001 to Yeari-1
if yi mod 4=0 then
if yi mod 100=0 then
if yi mod 1000=0 then
Days=Days+366
else
Days=Days+365
end if
else
Days=Days+366
end if
else
Days=Days+365
end if
Next
'月
For mi=1 to Monthi-1
Days=Days+MonthDays(Yeari,mi)
Next
Days=Days+Dayi
DayWeek=Days mod 7
End Function%>
Function DayWeek(Yeari,Monthi,Dayi)
Dim Days
Days=0
Dim yi,mi
'年
For yi=2001 to Yeari-1
if yi mod 4=0 then
if yi mod 100=0 then
if yi mod 1000=0 then
Days=Days+366
else
Days=Days+365
end if
else
Days=Days+366
end if
else
Days=Days+365
end if
Next
'月
For mi=1 to Monthi-1
Days=Days+MonthDays(Yeari,mi)
Next
Days=Days+Dayi
DayWeek=Days mod 7
End Function%>
解决方案 »
- php短信接口问题(无法获取回复的短信-移动MAS2.0 Webservice方式)
- PHP
- javascript中,倒计时,如果再刷新本页面,又会再倒计时怎么办,如何禁用(除了跳转页面的方法)
- PHP 插入数据库的问题。
- 兄弟们救命啊,谁给个详细的生成缩略图的程序,刚从.net转php菜鸟一个
- 为什么register_shutdown_function注册的函数无法运行system()???
- 好久没来这里了!
- apache 错误日志 一堆错该怎么解决
- 请教一个mysql中时间格式的问题
- 求救?
- 谁能详细介绍php中对mssql支持的命令用法
- 可稳定支持PHP的虚拟主机,现在这种服务不多了~~~~~~~~~~~~~~
var dt = new Date()
var y= dt.getYear()
var start = "1/1/"+ y
start = new Date(start)
starts = start.valueOf()
startweek = start.getDay()
dtweek = dt.getDay()
var days = Math.round((dt.valueOf()- start.valueOf())/(24*60*60*1000))-(7-startweek) - dt.getDay()-1
days = Math.floor(days/7)
alert(days+2)
</script>
周日做为下周的开始计算