Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date Math
Message
De
09/03/2004 10:26:38
 
 
À
09/03/2004 10:22:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00884427
Message ID:
00884428
Vues:
44
>Is there a simple way to manage leap year when doing calculations based on dates? The program I am working on processes records on an annual basis. Sometimes the records are terminated before the end of a full year and sometimes they are increased or decreased before a full year. Because of leap year some years have 364 days and others have 365. Does FoxPro have a built in way to deal with this, or is there an easy way to program for this anomaly?

Instead of doing math with the dates can you use the GOMONTH feature?
IF GOMONTH(startdate, 12) < enddate 
  *-- This is less than a year.
ELSE
  *-- A year or more.
ENDIF
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform