note 87707 deleted from function.mktime by aharvey
| From: | aharvey@php.net | Date: | Fri, 07 Sep 2012 01:18:23 +0000 |
| Subject: | note 87707 deleted from function.mktime by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190550@lists.php.net to get a copy of this message | ||
Note Submitter: electriic ink
----
Days until Christmas:
<?php
$time = mktime(0, 0, 0, 12, 25, 2008, 1) - time();
$days = floor($time/86400);
$hours = floor(($time-($days*86400))/3600);
$mins = floor (($time-($days*86400)-($hours*3600))/60);
$secs = floor ($time-($days*86400)-($hours*3600)-($mins*60));
$tsecs = $time;
$thours = round($time/3600);
if ($tsecs <= 600) {
echo '<html> <head> <title> ' . $tsecs . ' seconds left until
12am Christmas Day </title> <meta http-equiv="refresh"
content="1;url=""></head> <body><span
style="font-size:10pt">Christmas day in ' . $days . ' days ' . $hours .
' hours ' . $mins . ' mins ' . $secs . '
seconds!<br><br>(There are ' . $tsecs . ' seconds in
total)</span></body></html>';
} else {
echo '<html> <head> <title> ' . $thours . ' hours left until
12am Christmas Day </title> <meta http-equiv="refresh"
content="10;url=""></head> <body><span
style="font-size:10pt">Christmas day in ' . $days . ' days ' . $hours .
' hours ' . $mins . ' mins ' . $secs . '
seconds!<br><br>(There are ' . number_format($thours)
. ' hours in total and ' . number_format($tsecs) . ' seconds in
total)</span></body></html>';
}
?>