Re: date field

From: Date: Thu, 11 Aug 2005 05:30:49 +0000
Subject: Re: date field
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-220403@lists.php.net to get a copy of this message
In PHP, you could do something like:
$updated      = strtotime($db_result['updated']);
$one_year_ago = strtotime('-1 year'); if ($updated < $one_year_ago) {
    // updated date is older than a year ago
} 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' I've looked at: http://ca3.php.net/manual/en/function.getdate.php Thanks, John
-- Ben Ramsey http://benramsey.com/

« previous php.general (#220403) next »