xHarbour Reference Documentation > Function Reference |
Returns the number of days in a month.
DaysInMonth( <nMonth>, [<lLeapYear>] ) --> nDaysInMonth
The function returns the number of days in the specified month as a numeric value.
See also: | DaysToMonth(), IsLeap(), Month() |
Category: | CT:DateTime , Date and time |
Source: | ct\dattime2.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example displays the days in the current month. PROCEDURE Main LOCAL dDate := Date() ? DaysInMonth( Month(dDate), IsLeap() ) // result: 28, 29, 30 or 31 RETURN
http://www.xHarbour.com