I am doing a website where I needed to calculate the time left somewhere.both time(), and $endTime work properly individually but this calculation doesn’t seem to work
(it always shows 02:00:00):
$timeLeft = date('H:i:s',max(($endTime - time()) , 0));
Where is the problem?
edit:
$endTime = 1296727200
found the answer thanks to the comments,
the problem is that the $endTime was already smaller then time(), and then date(0)= January 1970, 02:00:00 in my timezone so it will be 02:00:00