Monday, 12 August 2013

Check if timestamp is 30 days ago

Check if timestamp is 30 days ago

i am trying to see if a timestamp is more than 30 days ago using this code:
$date=strtotime('2012-09-28');
if(strtotime($date) > strtotime('now +7 days'))
{
echo 'yes';
}
else
{
echo 'no';
}
but whatever the date is in the $date variable it says yes all the time.
any ideas how i can achieve this?

No comments:

Post a Comment