当前位置:首页>>网络编程>>ASP教程>>正文

ASP学习:VBScript WeekdayName 函数

文章出处:设计前沿收集 作者:未知 发布时间:2007-10-26 收藏到QQ书签

The WeekdayName function returns the weekday name of a specified day of the week.
WeekdayName 函数可以返回一个字符串,表示星期中指定的某一天

语法

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

参数 描述
weekday Required. The number of the weekday
必选项。星期中某天的数值定义。各天的数值定义取决于 firstdayofweek 参数设置。
abbreviate Optional. A Boolean value that indicates if the weekday name is to be abbreviated
可选项。Boolean 值,指明是否缩写表示星期各天的名称。如果省略, 默认值为 False,即不缩写星期各天的名称。
firstdayofweek Optional. Specifies the first day of the week.
可选项。指明星期第一天的数值

Can take the following values:
可以使用下面这些值:

  • 0 = vbUseSystemDayOfWeek - Use National Language Support (NLS) API setting
  • 1 = vbSunday - 星期日(默认)
  • 2 = vbMonday - 星期一
  • 3 = vbTuesday - 星期二
  • 4 = vbWednesday - 星期三
  • 5 = vbThursday - 星期四
  • 6 = vbFriday - 星期五
  • 7 = vbSaturday - 星期六

实例 1

document.write(WeekdayName(3))
输出:
Monday

实例 2

document.write(Date & "<br />")
document.write(Weekday(Date) & "<br />")
document.write(WeekdayName(Weekday(Date)))
输出:
10/22/2007
2
Monday

实例 3

document.write(Date & "<br />")
document.write(Weekday(Date) & "<br />")
document.write(WeekdayName(Weekday(Date),true))
输出:
10/22/2007
2
Mon

Google