Re: time question.
| From: | Rénald CASAGRAUDE | Date: | Fri, 26 Jul 2002 16:38:22 +0000 |
| Subject: | Re: time question. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109787@lists.php.net to get a copy of this message | ||
On Friday, July 26, 2002, at 05:53 PM, Steve Bradwell wrote:
Hi,Hi !
How do I compare time in php? Eg. If I have a mysql time field I retrieve stored in $result[0][0] how do I say :You can compare timesamp : o MySQL part : use UNIX_TIMESTAMP() function
http://www.mysql.com/doc/D/a/Date_and_time_functions.htmlo PHP part : use mktime() function
http://www.php.net/manual/en/function.mktime.php
if (($result[0][0] > $result[0][0] plus ten minutes) && ($result[0][0] > '00:00:00')){ ..... }Always FALSE !! You can't have $result[0][0] > $result[0][0] plus ten minutes You always have $result[0][0] > '00:00:00' So... TRUE && FALSE = FALSE R.