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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing #dateformat(now())# every X seconds

Status
Not open for further replies.

josel

Programmer
Oct 16, 2001
716
US
It is nice to show date and time on your page, but seconds later, that information is already old :)

How can you change your MONTH DAY, YEAR HH:MM:SS on page once CFML has already been resolved? I am looking for something that would appear as if a live timer is up there and not static text.

So far, I've found that I can use

<body onload=setinterval([some command or function],XXXX)>

which would execute [command or function] every XXXX miliseconds.

The real deal would be to write the command/function which would do this ... How?

Thank you all in advance;

josel If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
The easiest way would be to to set a meta tag in the header of the page that would refresh every few seconds.

e.g

<meta HTTP-EQUIV=&quot;Refresh&quot; CONTENT=&quot;20; URL=#cgi.script_name#&quot;>

This will refresh the page every 20 seconds. I am sure there is a better way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top