Reply to Re: date field

Your name:

Reply:


Posted by Ben Ramsey on 08/11/05 08:30

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/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация