Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very fast age calculation
Message
From
24/07/2000 13:04:40
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00396199
Message ID:
00396229
Views:
12
Hello, Ed.

Before posting that message, I have checked it.

Your method:
x=int((date()-birthdate)/365.25)

Here you have an example: my birthdate is 1968.12.23

a) int(({2000.12.23}-{1968.12.23})/365.25) gives 32. That's ok, but
b) int(({2001.12.23}-{1968.12.23})/365.25) gives 32. Corect answer is 33.


My method:

a) int((val(dtos({23.12.2000}))-val(dtos({23.12.1968})))/10000) gives 32 and
b) int((val(dtos({23.12.2001}))-val(dtos({23.12.1968})))/10000) gives 33
Grigore Dolghin
Class Software.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform