[PHP] age function

2005-05-04 Thread Ryan A
Hey, Anybody have an age function where i can pass a date object and get back an int? eg: $years_old=get_years(1979-12-07); Thanks, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.2 - Release Date: 5/2/2005 -- PHP

Re: [PHP] age function

2005-05-04 Thread Petar Nedyalkov
On Tuesday 03 May 2005 22:41, Ryan A wrote: Hey, Anybody have an age function where i can pass a date object and get back an int? eg: $years_old=get_years(1979-12-07); Use time and mktime. $birthday = 1979-12-07; $birdthday_time = mktime(0, 0, 0, substr($birthday, 5, 2),

Re: [PHP] age function

2005-05-04 Thread Mark Cain
] To: php php-general@lists.php.net Sent: Tuesday, May 03, 2005 3:41 PM Subject: [PHP] age function Hey, Anybody have an age function where i can pass a date object and get back an int? eg: $years_old=get_years(1979-12-07); Thanks, Ryan -- No virus found in this outgoing message. Checked

Re: [PHP] Age from birthdate?

2003-10-23 Thread Ryan A
Now HERES a good PHP related thread thats been going on for around 2 days...:-D Yes, but think about all the presents, hangovers, etc. they miss. On Thursday 23 Oct 2003 2:12 am, Mike Migurski wrote: I do wonder what the rule for those born on Feb 29'th. Do they celebrate they're birthday

Re: [PHP] Age from birthdate?

2003-10-23 Thread Nicholas Robinson
Oh, you're such a pedant. On Thursday 23 Oct 2003 9:08 pm, Ryan A wrote: Now HERES a good PHP related thread thats been going on for around 2 days...:-D Yes, but think about all the presents, hangovers, etc. they miss. On Thursday 23 Oct 2003 2:12 am, Mike Migurski wrote: I do wonder

Re: [PHP] Age from birthdate?

2003-10-23 Thread Ryan A
Nope, am a newbie here and I myself admit my grasp of php aint aint the best, but dont you think something as interesting as this should be discusses offlist? (And yes, I do see the irony of cc'ing this to the list...) Lastly, where in the world did you get pedant? word for the day or something?

Re: [PHP] Age from birthdate?

2003-10-23 Thread Mike Migurski
Lastly, where in the world did you get pedant? word for the day or something? :-D Thats a real unusual word for normal everyday use, unless you were trying to act pedant?? :- The correct adverbial form is pedantically ;) -

Re: [PHP] Age from birthdate?

2003-10-22 Thread Eugene Lee
On Wed, Oct 22, 2003 at 06:31:21PM +0200, DvDmanDT wrote: : : How would I get the age of someone if I store the birthdate in a date field? : I just realized FLOOR((UNIX_TIMESTAMP(NOW()) - : UNIX_TIMESTAMP(birthdate))/60/60/24/365.25) wont work for persons born : before 1970... :p I must get the

[PHP] Age from birthdate?

2003-10-22 Thread DvDmanDT
How would I get the age of someone if I store the birthdate in a date field? I just realized FLOOR((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(birthdate))/60/60/24/365.25) wont work for persons born before 1970... :p I must get the current age in years, and I must be able to select by age... :p Any

Re: [PHP] Age from birthdate?

2003-10-22 Thread Jason Wong
On Thursday 23 October 2003 00:31, DvDmanDT wrote: How would I get the age of someone if I store the birthdate in a date field? I just realized FLOOR((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(birthdate))/60/60/24/365.25) wont work for persons born before 1970... :p I must get the current age in

Re: [PHP] Age from birthdate?

2003-10-22 Thread Ashley M. Kirchner
Curt Zirzow wrote: I do wonder what the rule for those born on Feb 29'th. Do they celebrate they're birthday before or after it on non leap years? Neither. They celebrate it on Feb 29th. So while we age every year, they only age once every four. Make sense? -- H| I haven't lost my

Re: [PHP] Age from birthdate?

2003-10-22 Thread Curt Zirzow
* Thus wrote Ashley M. Kirchner ([EMAIL PROTECTED]): Curt Zirzow wrote: I do wonder what the rule for those born on Feb 29'th. Do they celebrate they're birthday before or after it on non leap years? Neither. They celebrate it on Feb 29th. So while we age every year, they only

RE: [PHP] Age from birthdate?

2003-10-22 Thread Martin Towell
* Thus wrote Ashley M. Kirchner ([EMAIL PROTECTED]): Curt Zirzow wrote: I do wonder what the rule for those born on Feb 29'th. Do they celebrate they're birthday before or after it on non leap years? Neither. They celebrate it on Feb 29th. So while we age every year,

Re: [PHP] Age from birthdate?

2003-10-22 Thread Mike Migurski
I do wonder what the rule for those born on Feb 29'th. Do they celebrate they're birthday before or after it on non leap years? Neither. They celebrate it on Feb 29th. So while we age every year, they only age once every four. Make sense? So their life expectancy is only ~19 years?

Re: [PHP] Age from birthdate?

2003-10-22 Thread John W. Holmes
DvDmanDT wrote: How would I get the age of someone if I store the birthdate in a date field? I just realized FLOOR((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(birthdate))/60/60/24/365.25) wont work for persons born before 1970... :p I must get the current age in years, and I must be able to select

Re: [PHP] Age from date field?

2003-10-12 Thread Eugene Lee
On Sun, Oct 12, 2003 at 02:09:38AM +0200, DvDmanDT wrote: : : Does anyone have a good solution on how to get the age of someone from a : date column in mysql... This is what I have, but it's not really the : truth... What's the right way to do it? : : floor((time()-$a[born])/(3600*24*365.25)) :

Re: [PHP] Age from date field?

2003-10-12 Thread Curt Zirzow
* Thus wrote Eugene Lee ([EMAIL PROTECTED]): On Sun, Oct 12, 2003 at 02:09:38AM +0200, DvDmanDT wrote: : : Does anyone have a good solution on how to get the age of someone from a : date column in mysql... This is what I have, but it's not really the : truth... What's the right way to do it?

Re: [PHP] Age from date field?

2003-10-12 Thread Eugene Lee
On Sun, Oct 12, 2003 at 02:49:53PM +, Curt Zirzow wrote: : * Thus wrote Eugene Lee ([EMAIL PROTECTED]): : On Sun, Oct 12, 2003 at 02:09:38AM +0200, DvDmanDT wrote: : : : : Does anyone have a good solution on how to get the age of someone from a : : date column in mysql... This is what I

[PHP] Age from date field?

2003-10-11 Thread DvDmanDT
Does anyone have a good solution on how to get the age of someone from a date column in mysql... This is what I have, but it's not really the truth... What's the right way to do it? floor((time()-$a[born])/(3600*24*365.25)) where $a[born] is the timestamp of the birthdate... Current query:

[PHP] Age

2002-02-09 Thread André Felix Miertschink
Could anybody find out the simplest method of calculating the age? The date of birth is in the format string ('01/01/1977'). André -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Age

2002-02-09 Thread Edward van Bilderbeek - Bean IT
, 2002 8:08 PM Subject: [PHP] Age Could anybody find out the simplest method of calculating the age? The date of birth is in the format string ('01/01/1977'). André -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General

[PHP] age

2001-08-05 Thread Jon Yaggie
does any one know where i can get a script that will convert a birthdate in to an age. i have one half written however i have incounter difficulties with dealing with leap years. perhaps soem one would know the solution . .. or just a premade script is fine $test = strtotime (January 12,

Re: [PHP] age

2001-08-05 Thread Corey Chapman
Here's something I use for a date string that looks like mm/dd/ to turn the date into an age from the current date. $age = explode(/, $bdate); $userage = date(Y) - $age[2]; if($age[0] date(m) || ( $age[0] == date(m) $age[1] date (d))) { --$userage; } if($userage 50) { $userage = ; } I

Re: [PHP] age

2001-08-05 Thread Tim
I've been using this one, which is probably close enough for government work ;) It calculates to a one-month resolution. // Calculates elapsed years between fdate and tdate. // The default for to date is today. function elapsed_years($fdate, $tdate=0) { if ($tdate == 0) {

Re: [PHP] age

2001-08-05 Thread Jan Wilson
* Jon Yaggie [EMAIL PROTECTED] [010805 16:35]: does any one know where i can get a script that will convert a birthdate in to an age. i have one half written however i have incounter difficulties with dealing with leap years. perhaps soem one would know the solution . .. or just a premade