Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Years and months between two dates
Message
From
22/11/1998 15:45:58
 
 
To
22/11/1998 13:16:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00160317
Message ID:
00160345
Views:
16
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.)
Previous
Reply
Map
View

Click here to load this message in the networking platform