RE: [PHP] Date question
| From: | John W. Holmes | Date: | Sun, 02 Mar 2003 05:40:17 +0000 |
| Subject: | RE: [PHP] Date question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137759@lists.php.net to get a copy of this message | ||
> I have used strtotime() function in the past, and done this:
>
> if($time >= strtotime('24 hours ago')) {
> $new = "new!";
> }
>
> with it being in UNIX time stamp .. But now I have a different client
> where
> the time stamp in mysql is formatted like:
> 2002-08-29 10:53:09
>
> what function would I use in this case, date() ? If so, how would I do
the
> same exact thing?
SELECT column - INTERVAL 24 HOUR FROM your_table WHERE ...
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/