Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates & Form

Status
Not open for further replies.

wuzzle

Programmer
Dec 20, 2000
75
CA
I'm trying to find out the difference between 2 dates. Can someone tell me why my second text field is empty? It's not finding the difference for some reason.

<script language=&quot;javascript&quot;>

function currentdate(){
var the_date = new Date();
document.luck.today.value=the_date;
}

function duedate(the_date){
var nowsec = now.getTime();
var doomsday=new Date(2000, 00, 01, 00, 00, 00);
var thensec = doomsday.getTime();
var ans = (thensec - nowsec) /1000 /60 /60 /24;
document.luck.daystill.value=ans;
}

</script>

Today's date: <input type=&quot;text&quot; name=&quot;today&quot;>

Remaining time until the contest is over: <input type=&quot;text&quot; name=&quot;daystill&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top