ChronosChronos

Get Days in Month

Get the number of total days in a month.

getDaysInMonth

Returns the number of total days in a month.

Function Signature

function getDaysInMonth(date?: DateArgs): NumberRange<28, 31>

Parameter

  • date: Date to get the number of days in the month. Can be string, number or Date object.

Info

If undefined or not provided, it will use the current date.

Returns

Returns the number of days in the month (28-31).

Note

Throws TypeError if the provided date is invalid (not parsable into a valid date by DateConstructor).

Example Usage

playground.ts

Last updated: Sun, Jun 28, 2026 05:23:19AM (UTC)

On this page