| 1 |
lars |
1 |
<?
|
|
|
2 |
function countDown($target)
|
|
|
3 |
{
|
|
|
4 |
$targetTime = strtotime($target);
|
|
|
5 |
$deltaT = $targetTime - time();
|
|
|
6 |
|
|
|
7 |
$minLength = 60;
|
|
|
8 |
$hourLength = $minLength * 60;
|
|
|
9 |
$dayLength = $hourLength * 24;
|
|
|
10 |
|
|
|
11 |
$timer = array();
|
|
|
12 |
$timer["zero"] = $targetTime;
|
|
|
13 |
$timer["Tage"] = floor($deltaT / $dayLength); $dayRest = $deltaT % $dayLength;
|
|
|
14 |
$timer["Stunden"] = floor($dayRest / $hourLength); $hourRest = $dayRest % $hourLength;
|
|
|
15 |
$timer["Minuten"] = floor($hourRest / $minLength); $minRest = $hourRest % $minLength;
|
|
|
16 |
$timer["Sekunden"] = $minRest;
|
|
|
17 |
return $timer;
|
|
|
18 |
}
|
|
|
19 |
$zeit = countDown("2006-06-09");
|
|
|
20 |
?>
|
|
|
21 |
<!-- <table border="1">
|
|
|
22 |
<tr>
|
|
|
23 |
<td colspan="4" align="center"><?=date("d.m.Y",$zeit["zero"]);?></td>
|
|
|
24 |
</tr>
|
|
|
25 |
<tr>
|
|
|
26 |
<td width="60" align="center">Tage</td>
|
|
|
27 |
<td width="60" align="center">Stunden</td>
|
|
|
28 |
<td width="60" align="center">Minuten</td>
|
|
|
29 |
<td width="60" align="center">Sekunden</td>
|
|
|
30 |
</tr>
|
|
|
31 |
<tr>
|
|
|
32 |
<td width="60" align="center"><?=$zeit["Tage"];?></td>
|
|
|
33 |
<td width="60" align="center"><?=$zeit["Stunden"];?></td>
|
|
|
34 |
<td width="60" align="center"><?=$zeit["Minuten"];?></td>
|
|
|
35 |
<td width="60" align="center"><?=$zeit["Sekunden"];?></td>
|
|
|
36 |
</tr>
|
|
|
37 |
</table>
|
|
|
38 |
-->
|
|
|
39 |
<table width="120" height="135" border="0" cellpadding="0" cellspacing="0">
|
|
|
40 |
<tr>
|
|
|
41 |
<td> <div align="center"><font size="2" face="Arial, Helvetica, sans-serif">
|
|
|
42 |
<?=$zeit["Tage"]; ?>
|
|
|
43 |
</font></div></td>
|
|
|
44 |
</tr>
|
|
|
45 |
</table>
|