Re: date field

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

 



John Taylor-Johnston wrote:
I have a field 'updated' How can I tell if the date is older than 1 year ago (or should I think of 365 days)?

`updated` date NOT NULL default '1999-12-12'

From the description you gave it looks like you're using a DBMS to store the date. If it's MySQL, then just do an SQL query with a WHERE clause like this:

WHERE updated > DATE_SUB(NOW(), INTERVAL 1 YEAR)

Jasper

--
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