VYPOCET ZVYSKU DNI

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

 

021
p021.html / p021.zip
Vypocitanie poctu dni, ktore uplynu pred udanym datumom
743b
NN 4.04, IE 4.0

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code:

<html> <head> <title> JavaScript DESTINATION - P021 </title> <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var data=""; function daysUntil(){ today = new Date(); BigDay = new Date(document.form.data.value); 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); minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60); alert("Pocet dni od specifikovaneho datumu: " + daysLeft); } // --> </SCRIPT> <body> <form NAME="form" onSubmit="daysUntil()"> <INPUT TYPE="text" NAME="data" VALUE="October 5, 1997"> <INPUT TYPE="submit" VALUE="Vysli"> </form> </body> </html>
[ Navrat / BACK ]