Latest web development tutorials

VBScript WeekdayName function

VBScript Reference Complete VBScript Reference

WeekdayName function returns the day of the week specified weekday name.

grammar

WeekdayName(weekday[,abbreviate[,firstdayofweek]])

参数 描述
weekday 必需。一周的第几天的数字。
abbreviate 可选。布尔值,指示是否缩写星期名。
firstdayofweek 可选。规定一周的第一天。

可采用下面的值:

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

Examples

Example 1

Being the first three days of the week Name:

<script type="text/vbscript">

document.write(WeekdayName(3))

</script>

Examples of the above output:

Tuesday

try it"

Example 2

Being the first three days of the week referred to as:

<script type="text/vbscript">

document.write(WeekdayName(3,True))

</script>

Examples of the above output:

Tue

try it"

Example 3

Being the first three days of the week the name of the first day of the week is Monday:

<script type="text/vbscript">

document.write(WeekdayName(3,False,2))

</script>

Examples of the above output:

Wednesday

try it"


VBScript Reference Complete VBScript Reference Manual