Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: laiko skaičiavimas

Parašė WantedBoy· 2008 Rugs. 25 14:09:34
#4

<SCRIPT LANGUAGE="JAVASCRIPT">
today = new Date();
BigDay = new Date("December 21, 2007")
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
e_minsLeft = Math.floor((e_hfrLeft - hrsLeft)*60);
minLeft = Math.floor(e_minLeft);
e_secLeft = Math.floor((e_minLeft - minLeft)*60);
secLeft = Math.floor(e_secLeft);


document.write( "(Liko iki svetes:) "+daysLeft+"</b> dienų, <b>"+hrsLeft+"</b> valandų ir <b>"+minsLeft+"</b> min. <b>"+secLeft+"</b> sec.");</SCRIPT>