Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
x = DATE(yr, mnth, 1) && yr = year, mnth = month
y = GOMONTH(x,1)
answer = y - x
?DaysInmOnth(DATE())
Function DaysInMonth
Parameter mDate
Private mDate,mDays,mDateFmt
mDateFmt = Set("Date")
set Date to British
mDays = Day(Ctod("1/"+alltrim(str(Month(mDate+32),2,0))+"/"+alltrim(str(Year(mDate+32),4,0)))-1)
Set Date to (mDateFmt)
return(mDays)
DAY(lastdayofmonth).
? LastDayOfMonth(Date())
Function LastDayOfMonth(tdDate)
Local ldDate
ldDate = tdDate+28
Return ldDate-DAY(ldDate)
Endif
? MonthDays(Date())
Function MonthDays(tdDate)
Local ldDate
ldDate = tdDate+28
Return DAY(ldDate-DAY(ldDate))
Endif
? DaysInMonth(date()) && Current date
? DaysInMonth(date(2004,10,10)) && A specific date
? DaysInMonth(ctod("2/21/2000")) && Leap month
function DaysInMonth(dDate)
local dMonthPlus1
dMonthPlus1 = gomonth(date(year(dDate),month(dDate),1),1)
return dMonthPlus1 - date(year(dDate),month(dDate),1)
endfunc