getYear
The getYear() function returns the year corresponding to a TheDate. An IANA timezone can be provided to adjust the result.
Interactive example
Syntax
typescript
function getYear<
GenericInput extends TheDate
>(
input: GenericInput,
timezone?: Timezone
): numberParameters
input: ImmutableTheDate.timezone: (Optional) IANA timezone (seedate/types/timezone).
Return value
The year (integer) corresponding to the date in the requested timezone.
