VBA/Excel/Access/Word/Date Functions/Day

Материал из VB Эксперт
Перейти к: навигация, поиск

Day(Date)

 
Sub Main1()
   Debug.Print "Today"s date is: " & Date
   Debug.Print "The day of the month is: " & Day(Date)
End Sub



Day(date) returns a Variant/Integer between 1 and 31, inclusive, representing the day of the month for date

 
Sub dateDemo5()
   If Day(Date) = 1 And Month(Date) = 1 Then MsgBox "Happy new year!"
End Sub