I never thought this would pick up this much speed actually.
HMG Program to Calculate your Age!
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5476
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG Program to Calculate your Age!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: HMG Program to Calculate your Age!
Yes, you are right, very hasty and dirtyPete-WG wrote:
... here is a "quick and dirty" version of your Dif2Date() function.
I very suspect that It has some problem(s), though... (particularly regarding years). Please make some tests, to see what i mean.
If 21/06/1957 is your birtday you are in 1951 year old. And if today is your anniversary you have no lived ( diff is 0 year, 0 month and 0 day ).
IMHO years is not problem, may be fix. Problem is when any partial element ( year, month, day) is zero ( out of range ).
"Please make some tests, to see what i mean."
A solution may be instead of date type data, return value of diffdate function will be an array with three numeric element.
Regards
esgici
Last edited by esgici on Fri Nov 04, 2011 5:09 pm, edited 1 time in total.
Viva INTERNATIONAL HMG
Re: HMG Program to Calculate your Age!
Hello Everybody! I came to know about this forum from Sudip. A special thanks to him, it seems everybody here are very helpful.
Thanks Giri for your age calculation sample. I've lost my clipper code of age calculation and this will help me. Not gone through your code minutely, hope it takes care of leap year factor during calculation.
Regards,
-- Swapan
Thanks Giri for your age calculation sample. I've lost my clipper code of age calculation and this will help me. Not gone through your code minutely, hope it takes care of leap year factor during calculation.
Regards,
-- Swapan
- Rathinagiri
- Posts: 5476
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG Program to Calculate your Age!
Welcome Swapan.
The logic is just (years - years), (months - months) and (days - days) and I am afraid I had not considered leap year factor.
The logic is just (years - years), (months - months) and (days - days) and I am afraid I had not considered leap year factor.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.