Skip to content

getDayOfMonth ​

The getDayOfMonth() function returns the day of the month (1–31) for a TheDate with an optional timezone.

Interactive example ​

Syntax ​

typescript
function getDayOfMonth<
	GenericInput extends TheDate | SerializedTheDate
>(
	input: GenericInput,
	timezone: Timezone = "UTC"
): number

Parameters ​

  • input: TheDate or SerializedTheDate.
  • timezone: IANA timezone. Default: "UTC".

Return value ​

Day of the month (1–31) in the given timezone.

See also ​

Sources ​

Released under the MIT license.