Source Code:
(back to article)
<?php $end_time = new DateTime("2022-12-31 23:59:59"); $current_time = new DateTime(); $interval = $current_time->diff($end_time); if ($interval->invert) { echo "The end date has already passed."; } else { echo $interval->format("Time left until 2022-12-31 23:59:59: %a days, %h hours, %i minutes, and %s seconds."); }
Result:
Report an issue