연도의 월을 나타내는 1~12 사이의 정수를 반환합니다.
구문
Month(date)
인수:
Date: 필수. 날짜를 나타낼 수 있는 표현식입니다.
지원되는 날짜 형식:
MM-DD-YYYYMM/DD/YYYYDD-MM-YYYYDD/MM/YYYYYYYY-MM-DDYYYY/MM/DD주석
다음 예에서는 Month 함수를 사용하여 현재 월을 반환합니다.
예 1:
Dim MyVar MyVar = Month(Now) 'Output: If current month is January, then it returns 1
예 2:
Dim MyDate, MyMonth MyDate = "21/01/2025" MyMonth = Month(MyDate) 'Output: 1 (January)
예 3:
Dim MyDate1, MyMonth1
MyDate1 = DateAdd("m", 5, "21/01/2025")
MyMonth1 = Month(MyDate1)
'Output: 6 (June)
예 4:
Dim MyDateTime2, MyMonth2 MyDateTime2 = "21/01/2025 18:45:30" ' Date-Time value. MyMonth2 = Month(MyDateTime2) ' Returns the month part of the date-time value. 'Output: 1 (January)