Latest web development tutorials

VBScript Weekday Fungsi

VBScript Referensi Lengkap VBScript Referensi

fungsi kerja mengembalikan jumlah minggu jumlah hari antara 1-7.

tatabahasa

Weekday(date[,firstdayofweek])

参数 描述
date 必需。要计算的日期表达式。
firstdayofweek 可选。规定一周的第一天。

可采用下面的值:

  • 0 = vbUseSystemDayOfWeek - 使用区域语言支持(NLS)API 设置
  • 1 = vbSunday - 星期日(默认)
  • 2 = vbMonday - 星期一
  • 3 = vbTuesday - 星期二
  • 4 = vbWednesday - 星期三
  • 5 = vbThursday - 星期四
  • 6 = vbFriday - 星期五
  • 7 = vbSaturday - 星期六

contoh

contoh

<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>

Contoh output di atas:

document.write(Weekday("2010-02-16",0) & "
") 3
2
1
7
6
5

Coba »


VBScript Referensi Lengkap VBScript Referensi