Custom Countdown Timer(Special)
Posted 16 August 2006 - 03:20 PM
I'd like to build a special custom countdown timer. What makes it special (and more complicated ) is its not going to countdown to a specified event(time,date) as the 100's of other scripts out there do.
Heres what i'd like it to do...
Have 4 cycles of 4.5 Days(108 hours)
Display how long it is to each new cycle start. - For example "2 Days, 8 hours and 5minutes until cycle#3"
Somehow be able to reset/calibrate/specify the countdown and cycle if the webserver went down or something.
This is continues btw... (except if the server goes down ofcourse;))
I think thats everything...
I'm guessing PHP is the way to go with this as we could still use the server to count with?
Thanks a bunch for any help you can give! This ones kicking my backside.
Posted 16 August 2006 - 03:29 PM
Posted 16 August 2006 - 03:36 PM
Posted 16 August 2006 - 03:50 PM
$now = time();
$difference = $until - $now;
$days = floor($difference/86400);
$difference = $difference - ($days*86400);
$hours = floor($difference/3600);
$difference = $difference - ($hours*3600);
$minutes = floor($difference/60);
$difference = $difference - ($minutes*60);
$seconds = $difference;
$output = "You have to wait $days Days, $hours Hours, $minutes Minutes and $seconds Seconds until this Day.";
//int mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] )
echo formatetimestamp(mktime(0,0,0,12,31,2006)); //output: e.g "You have to wait 162 Days, 4 Hours, 38 Minutes and 46 Seconds until this Day"
Posted 16 August 2006 - 06:11 PM
Doesn't do what I'd like...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users