Re: [PHP] date field

2005-08-10 Thread Jasper Bryant-Greene

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



[PHP] date field

2005-08-10 Thread John Taylor-Johnston
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'

I've looked at: http://ca3.php.net/manual/en/function.getdate.php

Thanks,
John

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