Method: DateSerial for VBS
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: DateSerial for VBS
Method: DateSerial for VBS
Specifies the date from the day, month, and year values.
vDateSerial = Object.DateSerial(Year, Month, Day)
| Object | VBS Object with this method. You do not need to specify this object. |
| Year | Variant Specifies a year. The valid range is between 0 and 9999. If you enter values between 0 and 99, the DateSerial method interprets this as the years 1900 to 1999. |
| Month | Variant Specifies a month. |
| Day | Variant Specifies a day in the month. |
| vDateSerial | Variant Receives a date. |
The following example displays a date:
Dim MyDate MyDate = DateSerial(2001, 12, 24) Call MsgBox(MyDate)