WeekDayName
Function
The WeekDayName function returns the name of the Weekday for the specified day.
Syntax
WeekdayName(weekday[,abbreviate[,firstdayofweek]])
Parameter Description
• weekday, a Required Parameter. The number of the weekday.
• toabbreviate, an Optional Parameter. A Boolean value Boolean
value that indicates if the month name is to be abbreviated.
If left blank, the default value would be taken as False.
• firstdayofweek, an Optional Parameter. Specifies the first day of the week.
o 0 = vbUseSystemDayOfWeek - Use National Language Support (NLS) API setting
o 1 = vbSunday - Sunday
o 2 = vbMonday - Monday
o 3 = vbTuesday - Tuesday
o 4 = vbWednesday - Wednesday
o 5 = vbThursday - Thursday
o 6 = vbFriday - Friday
o 7 = vbSaturday - Saturday
Example
<!DOCTYPE html>
<html>
<body>
<script language="vbscript" type="text/vbscript">
document.write("Line 1 : " &WeekdayName(3) & "<br />")
document.write("Line 2 : " &WeekdayName(2,True)& "<br />")
document.write("Line 3 : " &WeekdayName(1,False)& "<br />")
document.write("Line 4 : " &WeekdayName(2,True,0)& "<br />")
document.write("Line 5 : " &WeekdayName(1,False,1)& "<br />")
</script>
</body>
</html>
When you save it as .html and execute it in Internet Explorer,
then the above script will produce the following result:
Line 1 : Tuesday
Line 2 : Mon
Line 3 : Sunday
Line 4 : Tue
Line 5 : Sunday
No comments:
Post a Comment