Forum Moderators: mack

Message Too Old, No Replies

Monthly Calendar Countdown

Self updated countdown clock

         

webgurl

6:43 am on Jul 2, 2003 (gmt 0)

10+ Year Member



I'm in need of a clock with multiple features and text display.

1. It needs to be able to countdown calendar quarters - Jan 1-Mar 31, etc. ie: 10 days left in quarter

2. It needs to be able to countdown days in month - Mar 1-Mar 31, etc. ie: 5 days left in month

3. It needs to tell time and date. ie: Sunday, June 29, 2003 12:10 pm

Any help from you guys would be appreciated!

Rochelle

dmorison

8:57 am on Jul 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi webgurl,

JavaScript has tons of time functions that could be used to build such a clock.

Search on JavaScript+Time+Functions.

Here's a simple 24H HTML clock to get started with:

<div id='h'>00</div>:<div id='m'>00</div>:<div id='s'>00</div>

<script type='text/javascript'>

function updateclock()
{
now = new Date();

document.getElementById("h").innerHTML = now.getHours();

document.getElementById("m").innerHTML = now.getMinutes();

document.getElementById("s").innerHTML = now.getSeconds();
}

window.setTimeout("updateclock()",1000);

</script>

Search for a reference on the Date() function for the other methods that could be used to do what you want.