VBS TUTORIAL: function-weekday function _vbs

Source: Internet
Author: User

Weekday function

Returns an integer that represents the day of the week.

Weekday(date, [firstdayofweek])

Parameters

Date

An arbitrary expression that can represent a date. If NULL is included in the date argument, nullis returned.

FirstDayOfWeek

Specifies the constant for the first day of the week. If omitted, vbsundayis used by default.

Set up

The FirstDayOfWeek parameter has the following settings:

Constants 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

The weekday function returns the following values:

Constants 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 uses the weekday function to get the specified date as the day of the week:

Dim MyDate, MyWeekDayMyDate = #October 19, 1962#    Dispatch date. Weekday(MyDate) ' due to the  inclusion  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.