Re: Alternate to timediff() (might be slightly 0T)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Apr 9, 2005 1:09 PM, Ryan A <ryan@xxxxxxxxxxxx> wrote:
> So how can I compare 2 timedates which are:
> 
> now() and now() + 5 mins
> 
> to see if I get a positive or negitive value?

mysql> select NOW() > DATE_ADD( NOW(), INTERVAL 5 MINUTE );  
+----------------------------------------------+
| NOW() > DATE_ADD( NOW(), INTERVAL 5 MINUTE ) |
+----------------------------------------------+
|                                            0 |
+----------------------------------------------+
1 row in set (0.01 sec)

mysql> select NOW() < DATE_ADD( NOW(), INTERVAL 5 MINUTE ); 
+----------------------------------------------+
| NOW() < DATE_ADD( NOW(), INTERVAL 5 MINUTE ) |
+----------------------------------------------+
|                                            1 |
+----------------------------------------------+
1 row in set (0.00 sec)


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux