Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a function that returns the number of days in a
Message
De
10/11/2000 16:46:14
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/11/2000 12:31:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00440276
Message ID:
00440496
Vues:
14
>>>Is there a function that returns the number of days in a month?
>>>example...
>>>jan has 31 days
>>>days_in_a_month = (some_function,jan)
>>>?days_in_a_month
>>>31....any ideas?
>>
>>Nope but try
>>
>>** gets number of days in given month
>>ldDate = DATE() && or whatever
>>ldFirst = DATE(YEAR(ldDate), MONTH(ldDate), 1)
>>lnDaysInMonth = GOMONTH(ldFirst,1)-ldFirst

>
>Actually, you don't need the first 2 lines,
>IOW
>
>lnDaysInMonth = GOMONTH(ldDate,1)-ldDate

You do need those two lines, because if you're on Jan 31st, gomo(jan31,1) will give you February 29th (assume a leap year), and {feb 29}-{jan 31} would give you 29 instead of 31. Therefore, it's only safe to go back to 1st day of the month first.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform