echo date('H:i', time()); // 10:15
echo date('H:i', strtotime($this->deadline)); // 10:05
$delay = time() - strtotime($this->deadline);
echo date('H:i', $delay); // 02:10
Why delay is 2 hours 10 min instead of 10 min?
I assume it has something to do with timezone. Now it’s Europe/Helsinki. But how can I get just an absolute difference between two timestamps?
EDIT
echo time(); // 1339745334
echo strtotime($this->deadline); // 1339657500
$delay is not actually a proper timestamp. It’s just the difference between two timestamps, which could be as low as 1. mktime() function could be useful here.