monthOfYear

monthOfYear returns the 1-based value for the month of the year for a specified date-time.

Syntax

Parameters

ParameterTypeDescription
instantInstant

The date-time from which to return the number of months.

timeZoneZoneId

The time zone.

dateTimeZonedDateTime

The date-time from which to return the number of months.

Returns

Returns an int value representing the month of the year.

Examples