POCITADLO ZIVOTNOSTI

ID
Nazov / Name:
Popis / Description:
Dlzka / Length:
Testovane pod / Tested under:

 

155
p155.html / p155.zip
Urci podla zadaneho datumu, pocet uplynulych dni...
1982b
NN 4.04, IE 4.0

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code:

<html> <head> <title>JavaScript DESTINATION - P155</title> <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function lifetimer(){ today = new Date() BirthDay = new Date(document.live.age.value) timeold = (today.getTime() - BirthDay.getTime()); sectimeold = timeold / 1000; secondsold = Math.floor(sectimeold); msPerDay = 24 * 60 * 60 * 1000 ; timeold = (today.getTime() - BirthDay.getTime()); e_daysold = timeold / msPerDay; daysold = Math.floor(e_daysold); e_hrsold = (e_daysold - daysold)*24; hrsold = Math.floor(e_hrsold); minsold = Math.floor((e_hrsold - hrsold)*60); document.live.time1.value = daysold document.live.time2.value = hrsold document.live.time3.value = minsold window.status = "Pocet sekund, kolko zijete: " + secondsold; timerID = setTimeout("lifetimer()",1000) } // --> </script> </head> <BODY BGCOLOR="#FFFFFF"> <center> <h2>Pocitadlo zivotnosti</h2> <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var today = new Date() dayStr = today.toLocaleString(); document.write("<b>Dnesny datum: "); document.write(dayStr); document.write("</b>"); // --> </script> <br><br><br> <form name="live"> Vas vek: <INPUT TYPE="text" NAME="age" VALUE="" SIZE=20> Napr. (november 1,1966) <br><br><br> <INPUT TYPE="button" NAME="start" VALUE="Spust casovac" ONCLICK="lifetimer(this.form)"> <INPUT TYPE="reset" NAME="resetb" VALUE="Vynuluj vek"> <br><br> <table border=0> <tr><td>Pocet dni, kolko zijete: </td> <td> <INPUT TYPE="text" NAME="time1" VALUE="" size=8> </td> </tr> <tr><td>Pocet hodin, kolko zijete:</td> <td> <INPUT TYPE="text" NAME="time2" VALUE="" size=8> </td> </tr> <tr><td>Pocet minut, kolko zijete:</td> <td><INPUT TYPE="text" NAME="time3" VALUE="" size=8></td> </tr> </table> </form> </center> </body> </HTML>
[ Navrat / BACK ]