Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function to calculate days in a month?
Message
From
14/12/2000 17:54:45
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00453660
Message ID:
00453667
Views:
22
>Is there a built-in fuction that will return the days in a month from a particular date.
>
>Example:
>
>31 days in 1/2/2000
>29 days in 2/2/2000
>but
>28 days in 2/2/2001
>
>I know I could wite a fucntion which will return the days of the 12 months and to include the function to accomated the leap year. I am lokking for a built-in function.
>
>Thanks in advance.

Nothing built in, but you can get the last day of the month easily enough, therefore the number of days, e.g. this works for any date
dDate = Date()
dLastDay = Date(Year(GoMonth(dDate,1)),Month(GoMonth(dDate,1)),1)-1
nDayCnt = Day(dLastDay)
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform