<?php
$now = new DateTime();
$endOfDay = new DateTime("today 23:59:59");
$interval = $endOfDay->diff($now);
$hoursLeft = $interval->h;
$minutesLeft = $interval->i;
echo "{$hoursLeft} hours and {$minutesLeft} minutes remaining today.";
?>
[read_meter]
<?php
$now = new DateTime();
$endOfDay = new DateTime("today 23:59:59");
$interval = $endOfDay->diff($now);
$hoursLeft = $interval->h;
$minutesLeft = $interval->i;
echo "{$hoursLeft} hours and {$minutesLeft} minutes remaining today.";
?>
Category:
Tags: