Date and Time Constants

A number of functions (DateDiff, DatePart, Weekday, and WeekdayName) have a FirstDayOfWeek parameter whose value can be one of the day of the week constants (vbSunday through vbSaturday) as well as vbUseSystemDayOfWeek.

The DateDiff and DatePart functions also have a FirstWeekOfYear parameter whose value can be vbUseSystem, vbFirstJan1, vbFirstFourDays, vbFirstFullWeek.

Constant

Value

Description

vbSunday

1

Sunday

vbMonday

2

Monday

vbTuesday

3

Tuesday

vbWednesday

4

Wednesday

vbThursday

5

Thursday

vbFriday

6

Friday

vbSaturday

7

Saturday

vbUseSystem

0

Use the date format defined by the local computer’s regional settings

vbUseSystemDayOfWeek

0

Use the day of the week specified in your system settings for the first day of the week

vbFirstJan1

1

Use the week in which January 1 occurs; this is the default value for both DateDiff and DatePart

vbFirstFourDays

2

Use the first week that has at least four days in the new year

vbFirstFullWeek

3

Use the first full week of the year

Get VBScript in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.