Expand/Shrink

days_in_month

Definition: integer i = days_in_month(object y, integer m=0)
Description: y: a year such as 2022, or a result from date() or a timedate.
m: a month 1..12, ignored/overidden if y is a sequence.
returns an integer 28..31, respecting leaps years, etc.
pwa/p2js: Supported.
Comments: Added for timedate, and made available for general use.

Not suitable for use with years prior to the introduction of the Gregorian calendar.
Returns 0 if y < 1752, and invalid months (ie <1 or >12).
Example:
?days_in_month(2016,2)  -- prints 29
Implementation: See builtins\pdates.e (an autoinclude) for details of the actual implementation.
See Also: date, time, timedate