Purpose
Returns a date value given the year, month, and day as arguments.
If an invalid date has been specified, the system will display an error.
Syntax
DateSerial (Year, Month, Day)
Year |
Any numeric expression that evaluates to the integer values 100 to 9999 inclusive. |
Month |
Any numeric expression that evaluates to the integer values 1 to 12 inclusive. |
Day |
Any numeric expression that evaluates to the integer values 1 to 31 inclusive. |
Example
Sub Main ()
Dim myyear As Integer
Dim mymonth As Integer
Dim myday As Integer
Dim mybirthday As Date
myyear = 1971 : mymonth = 7 : myday = 9
mybirthday = DateSerial(myyear, mymonth, myday)
Print "My birthday is:", mybirthday
End Sub
|