Javascript Forum:
<script>
var startDate = new Date("1/1/2003"
function showTime(){
now = new Date();
milliSecs = now.getTime() - startDate.getTime()
//months is quirky - so I'll keep it simple
msSecs = 1000
msMins = msSecs * 60
msHours = msMins * 60
msDays = msHours * 24
days = Math.floor(milliSecs / msDays )
hours = Math.floor((milliSecs - (days * msDays)) / msHours)
minutes = Math.floor((milliSecs - (days * msDays) - (hours * msHours)) / msMins )
seconds = Math.floor((milliSecs - (days * msDays) - (hours * msHours) - (minutes * msMins)) / msSecs )
if (hours < 10){
hours = "0" + hours
}
if (minutes< 10){
minutes = "0" + minutes
}
if (seconds < 10){
seconds = "0" + seconds
}
document.myForm.timer.value = days + ":" + hours + ":" + minutes + ":" + seconds
timerID = setTimeout("showTime()",1000)
}
</script>
<body onLoad="showTime()">
<form name="myForm">
<input name="timer">
</form> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
mikewolf@tst-us.com