VBScript WeekdayNameFunction
Complete VBScript Reference Manual
The WeekdayName function returns the weekday name for a specified day of the week.
Syntax
WeekdayName(weekday[,abbreviate[,firstdayofweek]])
| Parameters | Description |
|---|---|
| weekday | Required. A number representing the day of the week. |
| abbreviate | Optional. A Boolean value indicating whether the weekday name is abbreviated. |
| firstdayofweek | Optional. Specifies the first day of the week. Can take the following values:
|
Examples
Example 1
Get the name of the 3rd day of the week:
<script type="text/vbscript">
document.write(WeekdayName(3))
</script>
document.write(WeekdayName(3))
</script>
The output result of the above example:
Tuesday
Try it yourself »
Example 2
Get the abbreviated name of the 3rd day of the week:
<script type="text/vbscript">
document.write(WeekdayName(3,True))
</script>
document.write(WeekdayName(3,True))
</script>
The output result of the above example:
Tue
Try it yourself »
Example 3
Get the name of the 3rd day of the week, with Monday as the first day of the week:
<script type="text/vbscript">
document.write(WeekdayName(3,False,2))
</script>
document.write(WeekdayName(3,False,2))
</script>
The output result of the above example:
Wednesday
Try it yourself »
Complete VBScript Reference Manual Other extensions