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 | SerializedTheDate
>(
input: GenericInput,
timezone: Timezone = "UTC"
): numberParameters
input:TheDateorSerializedTheDate.timezone: IANA timezone. Default:"UTC".
Return value
The year (integer) corresponding to the date in the requested timezone.
