This is what I use for our intranet, it is based on the server time

<script>
<cfoutput>
 var dateString = ("#dateFormat(now(),"MM/DD/YYYY")#
#timeFormat(now(),"hh:mm:ss")#");
 var i = #timeFormat(now(),"ss")#;
 </cfoutput>
 function updateClock(){
  var DateVariable = new Date(dateString);
  DateVariable.setSeconds(i);
  document.mainForm.date.value = DateVariable;
  i += 1;
  timer();
 }
 function firstLoad(){
  timer();
  updateClock();
 }
 function timer(){
  setTimeout('updateClock()',1000);
 }
</script>

<BODY ONLOAD="updateClock()">
<INPUT READONLY CLASS="clock" NAME="date" SIZE="30">



Doug
----- Original Message -----
From: "Gonzo Rock" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 11:15 AM
Subject: browser time display


> Curious if there is a way to show a constantly updating time display in a
browser... so that if the user idles for 30 minutes the time display keeps
advancing showing the correct time?
>
> thanks,
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to