Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number of days in a month
Message
 
 
To
07/10/1997 23:11:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00053634
Message ID:
00053637
Views:
32
>Is there a function to get the number of days in a month.
>eg. the number of days in any month of any year.
>
>Thanks
>Andrew

As long as I know VFP does not have a function for this, but is very easy you can make your own such as this

Function DaysOfMonth
Lpara tnMonth, tnYear
*-- have to pass the year also as parameter to find out if is a leap year

do case
case tnMonth=1
return 31
case tnMonth=2
if mod(tnYear,4)=0 &&leap year
return 29
else
return 28
endif
case tnMonth=3
return 31
etc...
etc...
endcase
Jorge Flores
From the Amigo Country
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform