Jeśli teraz uruchomiłbym skrypt to chciałbym zobaczyć ile zostało czasu do np. 6.08.2010 o 12.00
Jeśli uruchomię skrypt 10 to powinno odliczać czas do 12.08.2010.
To może wcale nie działać na zasadzie daty, tylko po prostu odliczać 259200 sekund. Tylko to musi się dziać po stronie serwera tak żeby uniknąć tego że gdy wejdzie nowa osoba zobaczy on 259200 s a nie tylko ile pozostało serwerowi.
Znalazłem coś takiego jednak to jest w js a chciałbym aby na serwie było to odliczane
<html> <head> <script type="text/javascript"> function display_c(start){ window.start = parseFloat(start); var end = 0 // change this to stop the counter at a higher value var refresh=1000; // Refresh rate in milli seconds if(window.start >= end ){ mytime=setTimeout('display_ct()',refresh) } else {alert("Time Over ");} } function display_ct() { // Calculate the number of days left var days=Math.floor(window.start / 86400); // After deducting the days calculate the number of hours left var hours = Math.floor((window.start - (days * 86400 ))/3600) // After days and hours , how many minutes are left var minutes = Math.floor((window.start - (days * 86400 ) - (hours *3600 ))/60) // Finally how many seconds left after removing days, hours and minutes. var secs = Math.floor((window.start - (days * 86400 ) - (hours *3600 ) - (minutes*60))) var x = window.start + "(" + days + " Days " + hours + " Hours " + minutes + " Minutes and " + secs + " Secondes " + ")"; document.getElementById('ct').innerHTML = x; window.start= window.start- 1; tt=display_c(window.start); } </script> </head> <body onload=display_c(259200);> <span id='ct' style="background-color: #FFFF00"></span> </body> </html>