Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Age calculation (Years, Months and days)
Message
From
17/09/2003 12:13:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00829932
Message ID:
00829947
Views:
19
>Hi Everybody.
>I want to calculate exact Age. I have problem in months and days calculation should I use 30.42 as average month or there is another way to calculate it.
>Thanks in advance
>Zaheer

I am curious - do you use the Gregorian (Christian) calendar? Because I understand that in the Islamic calendar (does it have a different official name?), the average age is more like 29.5 days.

Anyway, in the Gregorian calendar, the integer number of elapsed years can be calculated as follows:

int((val(dtos(date1)) - val(dtos(date2))) / 1e4)

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform