VBS Tutorial: function-Weekday Function

Source: Internet
Author: User

Weekday Function

Returns an integer representing the day of a week.

Weekday(date, [firstdayofweek])

Parameters

Date

It can represent any expression of a date. IfDateIf the parameter contains Null, returnNull.

Firstdayofweek

Specify the constant of the first day of the week. If omittedVbSunday.

Set

The firstdayofweek parameter has the following settings:

Constant Value Description
VbUseSystem 0 Use the regional language support (NLS) API settings.
VbSunday 1 Sunday
VbMonday 2 Monday
VbTuesday 3 Tuesday
VbWednesday 4 Wednesday
VbThursday 5 Thursday
VbFriday 6 Friday
VbSaturday 7 Saturday

Return Value

WeekdayThe function returns the following values:

Constant Value Description
VbSunday 1 Sunday
VbMonday 2 Monday
VbTuesday 3 Tuesday
VbWednesday 4 Wednesday
VbThursday 5 Thursday
VbFriday 6 Friday
VbSaturday 7 Saturday

Description

The following example usesWeekdayThe function returns the specified day of the week:

Dim MyDate, MyWeekDayMyDate = #October 19, 1962#    ' Dispatch date.MyWeekDay = Weekday(MyDate)    ' Because MyWeekDay Include 6,MyDate Represents Friday.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.