year
year returns the year for a date-time in the specified time zone.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| instant | Instant | The date-time from which to return the year. |
| timeZone | ZoneId | The time zone. |
| dateTime | ZonedDateTime | The date-time from which to return the year. |
Returns
Returns an int value of the year for a date-time.