Simple question, but I couldn't find any related topics that match this exact scenario. Everything I found involved MySQL or date and time rather than just time.
I have a timestamp stored in a variable in the format of:
1325960262
Produced by:
$newTimeStamp = time();
How can I check if this timestamp is older than 2 hours?
I tried:
if (strtotime($ratesTimeStamp) <= strtotime('-2 hours')) {
echo "OLDER";
} else {
echo "not older";
}
But no luck.
Drop the first strtotime
; the variable is already in timestamp form:
if ($ratesTimeStamp <= strtotime('-2 hours')) {
echo "OLDER";
} else {
echo "not older";
}