? Number of days in a month ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Number of days in a month

This function returns the day of the week of the 1st day in a month, and the number of days in that month. DEF MONTHINFO YEAR,MONTH OUT FIRSTDAY,DAYS VAR FIRST$="%04D/%02D/01" DTREAD FORMAT$(FIRST$,YEAR,MONTH) OUT ,,,FIRSTDAY INC MONTH IF MONTH>12 THEN DEC MONTH,12 INC YEAR ENDIF VAR NEXTFIRSTDAY DTREAD FORMAT$(FIRST$,YEAR,MONTH) OUT ,,,NEXTFIRSTDAY DAYS=(NEXTFIRSTDAY-FIRSTDAY+7) MOD 7 +28 END
Author
12Me21
Updated
Rating
1 vote
Categories
Keywords
  • date
  • month
  • days
  • weekday
  • week
  • calendar
0 Comment(s)