comparing dates

From: Date: Sun, 01 Feb 2004 23:04:28 +0000
Subject: comparing dates
Groups: php.general 
Request: Send a blank email to php-general+get-176529@lists.php.net to get a copy of this message
Hi, Am a bit confused as to how to do this, I have some dates in the database as "expire_login timestamp(14)". I am entering dates 1 day,11 hours,59 minutes in advance. The user can sign in anytime and it should display how many days, hours and mins before his account expires... I am selecting the data as "select expire_login, now() from allow_logins"; which gives me two 14 numberic characters strings like: 20040202091212 20040201070500 How do I compare it to display something like this to the visitor: You have $xdays day/s, $xhours hours and $xmins minutes before your account expires Been hitting the manual, but have either been searching in the wrong places or....? I think I will have to use "explode","strtotime" on this...but am not sure. Any help appreciated. Thanks, -Ryan

« previous php.general (#176529) next »