RE: [PHP] date math question
| From: | John W. Holmes | Date: | Fri, 28 Mar 2003 12:47:18 +0000 |
| Subject: | RE: [PHP] date math question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141431@lists.php.net to get a copy of this message | ||
> This leads me to another question. If I have stored the date as an
> epoch then is there a way using PHP and MySQL to say find all the
> records that have been added this YEAR (not last 365 days)?
SELECT * FROM table WHERE YEAR(FROM_UNIXTIME(column)) =
YEAR(CUR_DATE());
Benchmark each method and see which is faster...
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/