Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
$return = array();
$difference = $time_b - $time_a;
$return['days'] = floor($difference / (60 * 60 * 24));
$difference -= $return['days'] * (60 * 60 * 24);
$return['hours'] = floor($difference / (60 * 60));
$difference -= $return['hours'] * (60 * 60);
$return['minutes'] = floor($difference / 60);
$difference -= $return['minutes'] * 60;
$return['seconds'] = $difference / 60;
return $return;
modulus - Returns the remainder obtained by dividing the first argument by the second argument
Das Ergebnis ist erschreckendOriginal geschrieben von won_gak
PHP:$return = array(); $difference = $time_b - $time_a; $return['days'] = floor($difference / (60 * 60 * 24)); $difference -= $return['days'] * (60 * 60 * 24); $return['hours'] = floor($difference / (60 * 60)); $difference -= $return['hours'] * (60 * 60); $return['minutes'] = floor($difference / 60); $difference -= $return['minutes'] * 60; $return['seconds'] = $difference / 60; return $return;
<?php
function diff($b_time){
$now = mktime();
$time_a = mktime(20,0,0,date("n",$now),date("j",$now),date("Y",$now));
$return = array();
$difference = $time_b - $time_a;
$return['days'] = floor($difference / (60 * 60 * 24));
$difference %= $return['days'] * (60 * 60 * 24);
$return['hours'] = floor($difference / (60 * 60));
$difference %= $return['hours'] * (60 * 60);
$return['minutes'] = floor($difference / 60);
$difference %= $return['minutes'] * 60;
$return['seconds'] = $difference / 60;
return $return;
}
$zeit = mktime() + "3600";
$noch = diff($zeit);
if($noch["days"]!=""){
echo $noch["days"]."T ";
}
if($noch["hours"]!=""){
echo $noch["hours"]."Std ";
}
if($noch["minutes"]!=""){
if($noch["days"]=="" && $noch["hours"]==""){
echo "<span class=\"red\">".$noch["minutes"]."Min</span>";
}
else {
echo $noch["minutes"]."Min";
}
}
?>
Oh shitOriginal geschrieben von won_gak
Sorry, ich hatte da noch das falsche drin.
-= statt %=
Ich bin auch verwirrt. Der bekannte Zeitpunkt (20 Uhr) ist doch immer beim END-Zeitpunkt, und nicht beim aktuellen timestamp? Du hast aber bei mktime () 20 stehen bei den Stunden... das kann logisch nicht ganz gehen.