xHarbour Reference Documentation > Function Reference |
Returns the number of days from first January to the beginning of a month.
DaysToMonth( <nMonth>, [<lLeapYear>] ) --> nDays
The function returns the number of days from first January to the first day of the specified month as a numeric value.
See also: | Day(), DaysInMonth(), DoY(), IsLeap(), Month() |
Category: | CT:DateTime , Date and time |
Source: | ct\dattime2.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example displays results of DaysToMonth() PROCEDURE Main LOCAL dDate := StoD( "20061101" ) ? DaysToMonth( 1 ) // result: 0 ? DaysToMonth( 3 ) // result: 59 ? DaysToMonth( 3, .T. ) // result: 60 ? DaysToMonth( 11 ) // result: 304 ? DoY( dDate ) // result: 305 RETURN
http://www.xHarbour.com