Javatpoint Logo
Javatpoint Logo

Java Date getMonth() Method

The getMonth() method of Java Date class returns the value between 0 to 11 which represents the month of the year. This method is deprecated as of JDK version 1.1 and replaced by Calender.get(Calender.MONTH)

Value Month
0 January
1 February
2 March
3 April
4 May
5 June
6 July
7 August
8 September
9 October
10 November
11 December

Syntax:

Parameters

NA

Return

It returns the month of the year represented by this date object.

Example

Test it Now

Output:

Month of the year is  : 8

Next TopicJava Util Date





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA