PHP gmdate find out if it's been a year
I was just wondering how you would be able to find out if something is x amount old. My problem is that I want to find out if this item is a year old, but I'm using unix timestamp. I convert it using gmdate so that it's read-able. Next, I try to compare it to 3600, but it's not working.
Here's my code below.
$unix_timestamp = 1373058307;
$gmdate = gmdate("m/d/Y", $unix_timestamp);
echo $gmdate;
if($gmdate >= 3600) {
echo "<br>1 year already";
} else {
echo "<br>Hasn't been a year yet";
}
The echo $gmdate is just to test what date it's on. And I get 07/05/2013 which is the correct date I'm looking for. Now since it's 2015, I want to compare it so that it says 1 year already. I know I should check to see if it's 2 years, but this particular thing I'm doing only needs to be checked if it's a year or more.
I'm not sure if I'm doing it right.