getMonth
The getMonth() function returns the month (1–12) corresponding to a TheDate, with optional support for an IANA timezone.
Interactive example
Syntax
typescript
function getMonth<
GenericInput extends TheDate
>(
input: GenericInput,
timezone?: Timezone
): numberParameters
input:TheDateto analyze.timezone: (Optional) IANA timezone.
Return value
An integer between 1 and 12 (January = 1).
