Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Years and months between two dates
Message
De
22/11/1998 15:45:58
 
 
À
22/11/1998 13:16:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00160317
Message ID:
00160345
Vues:
20
The following routine will give you a good approximation, but the best unit of mesure is in number of days.

lnDiff = tdSecondDate - tdFirstDate
lnYear = Int(lnDiff / 365)
lnDiff = lnDiff - (lnYear * 365)
lnMonth = Int(lnDiff / 30)
lnDay = lnDiff - (lnMonth * 30)

HTH

>Does anybody have a quick routine that will calculate the number of years, months and days between two given dates? (Taking into account leap years, millenium, etc.)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform