Time left => server time

<?php

//Convert to date
$datestr=”2015-11-23 12:00:00″;//Your date
$date=strtotime($datestr);//Converted to a PHP date (a second count)

//Calculate difference
$diff=$date-time();//time returns current time in seconds
$days=floor($diff/(60*60*24));//seconds/minute*minutes/hour*hours/day)
$hours=round(($diff-$days*60*60*24)/(60*60));

//Report
echo “<p style=\”font-size:3em\”><strong>Spuštění proběhne za “.”$days (dny) a za $hours (hodin). </strong></p>”;
?>

Leave a Reply

Your email address will not be published. Required fields are marked *