DateAndTime.Month(DateTime) 메서드

정의

월을 나타내는 1에서 12까지의 정수 값을 반환합니다.

public:
 static int Month(DateTime DateValue);
public static int Month (DateTime DateValue);
static member Month : DateTime -> int
Public Function Month (DateValue As DateTime) As Integer

매개 변수

DateValue
DateTime

필수 요소. 월을 추출할 Date 값입니다.

반환

월을 나타내는 1에서 12까지의 정수 값입니다.

예제

이 예제에서는 함수를 Month 사용하여 지정된 날짜로부터 월을 가져옵니다. 개발 환경에서 날짜 리터럴은 코드의 로캘 설정을 사용하여 짧은 날짜 형식으로 표시됩니다.

Dim thisDate As Date
Dim thisMonth As Integer
thisDate = #2/12/1969#
thisMonth = Month(thisDate)
' thisMonth now contains 2.

설명

인수에 대해 를 호출 DatePart 하고 지정하여 연중 월을 가져올 수도 있습니다DateInterval.Month.Interval

적용 대상

추가 정보