Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Age calculation

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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
nike
New php-forum User
New php-forum User
 
Posts: 7
Joined: Fri Sep 06, 2002 7:59 am
Location: Ukraine

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron