Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
1192831200
<?php
$start = 1192831200;
if(time() > $start) {
$sekunden = time()-$start;
$minuten = 0;
$stunden = 0;
$tage = 0;
while($sekunden >= 60) {
$minuten++;
$sekunden -= 60;
}
while($minuten >= 60) {
$stunden++;
$minuten -= 60;
}
while($stunden >= 24) {
$tage++;
$stunden -= 24;
}
while($tage >= 7) {
$wochen++;
$tage -= 7;
}
echo 'Seit '.date('d.m.Y - G:i:s',$start).' sind ';
echo $wochen.' Woche(n), ';
echo $tage.' Tag(e), ';
echo $stunden.' Stunde(n), ';
echo $minuten.' Minute(n) und ';
echo $sekunden.' Sekunde(n) ';
echo 'vergangen.';
}
?>
<?php
$startpunkt = Array(
"sekunde" => 0,
"minute" => 0,
"stunde" => 0,
"tag" => 17,
"monat" => 9,
"jahr" => 2007
);
$start = mktime($startpunkt["sekunde"],$startpunkt["minute"],$startpunkt["stunde"],$startpunkt["monat"],$startpunkt["tag"],$startpunkt["jahr"]);
if(time() > $start) {
//Rest wie oben
?>
<?php
class Timer {
function Timer($sekunde,$minute,$stunde,$tag,$monat,$jahr) {
$this->now = time();
$this->id = uniqid();
$this->point = mktime($sekunde,$minute,$stunde,$monat,$tag,$jahr);
if($this->now > $this->point)
$this->Build();
}
function Build() {
$sekunden = $this->now - $this->point;
list($sekunden,$minuten) = $this->Parse($sekunden,60);
list($minuten,$stunden) = $this->Parse($minuten,60);
list($stunden,$tage) = $this->Parse($stunden,24);
list($tage,$wochen) = $this->Parse($tage,7);
$this->javaScript();
echo '
Seit dem '.date("d.m.Y - G:i:s",$this->point).' sind
<span id="wochen'.$this->id.'">'.$wochen.'</span> Woche(n),
<span id="tage'.$this->id.'">'.$tage.'</span> Tag(e),
<span id="stunden'.$this->id.'">'.$stunden.'</span> Stunde(n),
<span id="minuten'.$this->id.'">'.$minuten.'</span> Minute(n),
<span id="sekunden'.$this->id.'">'.$sekunden.'</span> Sekunde(n)
vergangen.
';
}
function Parse($arg,$max) {
$rest = 0;
while($arg >= $max) {
$rest++;
$arg -= $max;
}
return Array($arg,$rest);
}
function JavaScript() {
echo '
<script type="text/javascript">
<!--
function startcountup'.$this->id.'() {
window.setInterval("countup'.$this->id.'()",1000)
}
function countup'.$this->id.'() {
sekunden = parseInt(document.getElementById("sekunden'.$this->id.'").innerHTML)
sekunden = sekunden+1
if(sekunden < 60)
document.getElementById("sekunden'.$this->id.'").innerHTML = sekunden
else {
document.getElementById("sekunden'.$this->id.'").innerHTML = 0
document.getElementById("minuten'.$this->id.'").innerHTML = parseInt(document.getElementById("minuten'.$this->id.'").innerHTML)+1
}
if(parseInt(document.getElementById("minuten'.$this->id.'").innerHTML) >= 60) {
document.getElementById("minuten'.$this->id.'").innerHTML = 0
document.getElementById("stunden'.$this->id.'").innerHTML = parseInt(document.getElementById("stunden'.$this->id.'").innerHTML)+1
}
if(parseInt(document.getElementById("stunden'.$this->id.'").innerHTML) >= 24) {
document.getElementById("stunden'.$this->id.'").innerHTML = 0
document.getElementById("tage'.$this->id.'").innerHTML = parseInt(document.getElementById("tage'.$this->id.'").innerHTML)+1
}
if(parseInt(document.getElementById("tage'.$this->id.'").innerHTML) >= 7) {
document.getElementById("tage'.$this->id.'").innerHTML = 0
document.getElementById("wochen'.$this->id.'").innerHTML = parseInt(document.getElementById("wochen'.$this->id.'").innerHTML)+1
}
}
-->
</script>
';
}
function start() {
return 'startcountup'.$this->id.'()';
}
function startJavaScript($scripts) {
echo '<script type="text/javascript"><!--'."\n";
echo 'window.onload = function() {'."\n";
foreach($scripts as $script) {
$verzögerung = rand(0,1000);
echo 'window.setTimeout("'.$script.'",'.$verzögerung.')'."\n";
}
echo '}'."\n";
echo '--></script>';
}
}
?>
$timer[] = new Timer(0,0,0,17,9,2007);
$timer[] = new Timer(0,0,0,17,9,2007);
echo "<br>";
$timer[] = new Timer(0,0,16,19,10,2007);
foreach($timer as $single)
$move[] = $single->start();
Timer::startJavaScript($move);