Displaying daily account in php
2 answers
<?php
$event_date = '2010-01-01 00:00:00';
$event_time = strtotime($event_date);
$diff = $event_time - time();
echo floor($diff/(24*60*60)).' days to go for the great event';
?>
Note . I completely reject any timezone considerations, so be sure to read the timezone questions related to using PHP functions datetime
.
+9
a source to share