DaysInMonth
Returns the number of days in the month of a date object. If a string is provided as the argument, an attempt will be made to parse it as a date. If parsing fails, an error will be thrown.
Method Signature
DaysInMonth(date=[any], timezone=[string], locale=[string])Arguments
Argument
Type
Required
Description
Default
date
any
false
The date object or date string to be evaluated.
timezone
string
false
An optional timezone which to convert the date object to
locale
string
false
An optional ISO locale string which will return the specified time unit with a locale-specific result ( e.g. month name, or starting day of week as Monday vs Sunda )
Examples
Related
Last updated
Was this helpful?
