Countdown To A Date in PHP

0
709

If you wish a script in PHP that will countdown the time you can use the following code:

$dtt_end = new DateTime('January 3, 2030 2:00 PM'); // the date to count down
$remain = $dtt_end->diff(new DateTime());
echo $remain->d . ' days, ' . $remain->h . ' hours';

So this is a simple refresh script that will show on the browser without any javascript, CSS or some other design….

If you wish something more complex you can start with this idea

LEAVE A REPLY

Please enter your comment!
Please enter your name here