note 51090 added to function.date
| From: | dzimi-21 at o2 dot pl | Date: | Sat, 19 Mar 2005 10:34:39 +0000 |
| Subject: | note 51090 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86683@lists.php.net to get a copy of this message | ||
Here is my way to count down to specified date:
<?
$end = mktime(23,30,0,4,27,2005);
$today= mktime(date("G"),date("i"),
date("s"),date("m"),date("d"),date("Y"));
$days=($end-$today)/86400;
if ($days>0) {
$r1 = explode('.',$days);
$hours=24*($days-$r1[0]);
$r2 = explode('.',$hours);
$minutes=60*($hours-$r2[0]);
$r3 = explode('.',$minutes);
$seconds=60*($minutes-$r3[0]);
$r4 = explode('.',$seconds);
echo 'Days left: ' .$r1[0];
echo '<br>Time left: ' . $r2[0] . ':' . $r3[0] . ':' . $r4[0];
} else {
echo "Matrix 4 is here:)";}
?>
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51090
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51090&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51090&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51090&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51090&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51090&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51090&report=yes
Search -- http://master.php.net/manage/user-notes.php