Age calculation

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

nike
New php-forum User
New php-forum User
Posts: 7
Joined: Fri Sep 06, 2002 7:59 am
Location: Ukraine
Contact:

Postby nike » Sat Nov 23, 2002 3:49 am

Hello!

You can use this code:

Code: Select all

$str = $row[bday].'/'.$row[bmonth].'/'.$row[byear];
$time=time();
if (($timestamp = strtotime($str)) === -1) {
    echo "The string ($str) is bogus";
} else {
    $life_in_seconds=$time-$timestamp;
    $life_in_minutes=$life_in_seconds/60;
    $life_in_hours=$life_in_minutes/60;
........
}


--------------
Bereza Nikita
Rapid Internet Development Department
E-mail: nike@alarit.com
Alar Information Technologies,
URL: http://www.alarit.com

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 4 guests

cron