The getMonth() method of a ZonedDateTime class is used to get month-of-year field using the Month enum from this ZonedDateTime. If you need access to the primitive int value then the enum provides the int value.
public Month getMonth()
Parameters: This method does not take any parameters.
Return value: This method returns an enum Month representing the month-of-year.
Below programs illustrate the getMonth() method:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.