VBScript Weekday 函数
完整的 VBScript 参考手册
Weekday 函数返回表示一周的天数的数字,介于 1 到 7 之间。
语法
Weekday(date[,firstdayofweek])
参数 | 描述 |
---|---|
date | 必需。要计算的日期表达式。 |
firstdayofweek | 可选。规定一周的第一天。 可采用下面的值:
|
实例
实例
<script type="text/vbscript">
document.write("document.write(Weekday(" & chr(34) & "2010-02-16" & chr(34) & ",0) & " & chr(34) & "<br />" & chr(34) & ")
") document.write(Weekday("2010-02-16",1) & "<br />")
document.write(Weekday("2010-02-16",2) & "<br />")
document.write(Weekday("2010-02-16",3) & "<br />")
document.write(Weekday("2010-02-16",4) & "<br />")
document.write(Weekday("2010-02-16",5) & "<br />")
document.write(Weekday("2010-02-16",6) & "<br />")
</script>
document.write("document.write(Weekday(" & chr(34) & "2010-02-16" & chr(34) & ",0) & " & chr(34) & "<br />" & chr(34) & ")
") document.write(Weekday("2010-02-16",1) & "<br />")
document.write(Weekday("2010-02-16",2) & "<br />")
document.write(Weekday("2010-02-16",3) & "<br />")
document.write(Weekday("2010-02-16",4) & "<br />")
document.write(Weekday("2010-02-16",5) & "<br />")
document.write(Weekday("2010-02-16",6) & "<br />")
</script>
以上实例输出结果:
document.write(Weekday("2010-02-16",0) & "
") 3
2
1
7
6
5
") 3
2
1
7
6
5
尝试一下 »
完整的 VBScript 参考手册
点我分享笔记