All pastes #462105 Raw Edit

Stuff

public text v1 · immutable
#462105 ·published 2007-04-28 01:50 UTC
rendered paste body
        // CoUnTdOwN script created by: Xander Ladage (2006)
        // Give timepeaces for the event you want to count down to
        // You can also perform some action between two moments 
        // (for instance do something for just one month)
        // Please do not remove this peace of comment!
        
        // SIMPLY COUNTDOWN to some moment:
        
        $year   = 2009;
        $month  = 12;
        $day    = 31;
        $hour   = 23;
        $minute = 59;
        $second = 59;

        countdiff($year,$month,$day,$hour,$minute, $second);

        function countdiff($y, $mo, $d, $h, $m, $s){
            $cdate = mktime($h, $m, $s, $mo, $d, $y, -1);
            $today = time();
            $difference = $cdate - $today;
            
            if ($difference == 0 || $difference < 0 ){
                echo '<br><br>WE MADE IS !!! COUNTER MOMENT IS REACHED !!!';
            } else {
                $dleft = floor($difference/60/60/24);
                $hleft = floor(($difference - $dleft*60*60*24)/60/60);
                $mleft = floor(($difference - $dleft*60*60*24 - $hleft*60*60)/60);
                $sleft = floor(($difference - $dleft*60*60*24 - $hleft*60*60 - $mleft*60));
                $countdowndate =  date("l j F Y, G:i:s",$cdate);
                $currenttime = date("j F Y, G:i:s",$today);
                echo '<hr><table><tr><td><span class="blue">Current time is: </span></td><td><span class="red">'.$currenttime.'</span></td></tr>';
                echo '<tr><td><span class="blue">We are counting down to:</span></td><td><span class="red">'.$countdowndate.'</span></td></tr></table>';
                echo '<span class="blue"><br>&nbsp;So there are still: <span class="red">'.$dleft.'</span> days, <span class="red">'.$hleft.'</span> hours, <span class="red">'.$mleft.'</span> minutes and <span class="red">'.$sleft.'</span> seconds to go<br><br></span><hr>';
            }
        }