note 26903 deleted from function.date by victor
| From: | victor@php.net | Date: | Sun, 08 Dec 2002 20:05:51 +0000 |
| Subject: | note 26903 deleted from function.date by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40539@lists.php.net to get a copy of this message | ||
There is a mistake in the (some way up) upper example.
If you want to find out how much time is left to a date (e.g. timestamp taken from postgres) you can
do sth like this:
$fifi = strtotime(!!timestamp!!) - time();
in place of !!timestamp!! you can put any string, e.g. pg_result($result,0,datetime) from your
database.
$fifi contains number of seconds beetween the date and current date. Now you only have to div it
e.g. by 3600 to get number of hours.. and so on...
$fifi is negative (<0) when the day has passed, and is >0 when it hasn't been reached
yet. It IS very useful knowledge ;)
sorry but i'm not good in explaining things..