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 | SerializedTheDate
>(
input: GenericInput,
timezone: Timezone = "UTC"
): numberParameters
input:TheDateorSerializedTheDate.timezone: IANA timezone. Default:"UTC".
Return value
An integer between 1 and 12 (January = 1).
