You are here: Re: [PHP] Alternate to timediff() (might be slightly 0T) « PHP « IT news, forums, messages
Re: [PHP] Alternate to timediff() (might be slightly 0T)

Posted by Greg Donald on 04/09/05 21:18

On Apr 9, 2005 1:09 PM, Ryan A <ryan@coinpass.com> 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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация