Countdown clock that resets automatically?

I want to add a javascript clock to my web page that counts down DAILY from 8:00 until 17:00 EST... It should display the current date and time and the time left until 17:00...

Ex: November 7, 2007 11:35 EST ------- 5 Hours, 25 minutes remaining until ....

I can find scripts on the web that already do this. However, this repeats EACH day Monday thru Friday from 8:00 until 17:00... So at 8:00 the following day, the counter should reset and begin another cycle...

Ideally, I would want this to be automatic so I didn't have to change the ending date each day...

Any ideas on how I should proceed?
bfhiiiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pravin AsarPrincipal Systems EngineerCommented:
<script language="javascript">
function NeedCntDown() {
var dt = new Date();
// Sunday = 0, Saturday = 6
// Do counter on Monday and Fridays
if (dt.getDay() == 1 || dt.getDay() == 5) {
   //
   // Your script goes here.
  //
}
</script>
0
rama_krishna580Commented:
Hi,

<head>
<script LANGUAGE="JavaScript">
<!--
// Javascript Countdown
// Version 1.0 1/20/2000
// by TDavid at http://www.tdscripts.com/
var now = new Date();
var event = new Date("Sep 29 2001 00:00:01");
var seconds = (event - now) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
ID=window.setTimeout("update();", 1000);
function update() {
now = new Date();
seconds = (event - now) / 1000;
seconds = Math.round(seconds);
minutes = seconds / 60;
minutes = Math.round(minutes);
hours = minutes / 60;
hours = Math.round(hours);
days = hours / 24;
days = Math.round(days);
document.form1.days.value = days;
document.form1.hours.value = hours;
document.form1.minutes.value = minutes;
document.form1.seconds.value = seconds;
ID=window.setTimeout("update();",1000);
}
// --></script>
</head>
<body>

<p><font face="Arial" size="3">Countdown To September 29, 2001, at 12:00: </font></p>
<form name="form1"><p>Days <input type="text" name="days" value="0" size="3"> Hours
<input type="text" name="hours" value="0" size="4"> Minutes <input type="text" name="minutes" value="0"
size="7"> Seconds <input type="text" name="seconds" value="0" size="7"> </p>
</form>

</body>
</html>

http://www.tdscripts.com/jscountdown.html

R.K
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.