getDaysInMonth

Modified on Tue, 22 Aug 2023

Description

Use this function to get the number of days in a month of the given date.

Syntax

getDaysInMonth(date)

Returns

Return ValueDescription
NumberReturns the number of days in the month of the given date.

Sample

ExampleResultDescription
getDaysInMonth(2023-04-08)30Returns the number of days in the month, which is 30, for the given date.

To view all the Date functions, click here.

See Also