Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very fast age calculation
Message
 
À
24/07/2000 13:04:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00396199
Message ID:
00396397
Vues:
10
Why not just year(date())-year(birthday) ?

*--------youir message below

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
All the best,
Grig
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform