Query Master Query Master - 1 year ago 78
PHP Question

PHP server time convert to left hours count

I have a PHP Server time like this enter image description here and I need to convert this time into left hours count like this

6 hours lefts
7 hours lefts

Answer Source
$time_left = floor((time() - strtotime($server_time)) / 3600);
echo $time_left.' hours left';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download