<SCRIPT>function tick() {
  var hours, minutes, seconds, ap;
  var intHours, intMinutes, intSeconds;
  var today;

  today = new Date();

  intHours = today.getHours();
  intMinutes = today.getMinutes();
  intSeconds = today.getSeconds();

  if (intHours == 0) {
     hours = "12:";
     ap = "Midnight";
  } else if (intHours < 12) { 
     hours = intHours+":";
     ap = "A.M.";
  } else if (intHours == 12) {
     hours = "12:";
     ap = "Noon";
  } else {
     intHours = intHours - 12
     hours = intHours + ":";
     ap = "P.M.";
  }

  if (intMinutes < 10) {
     minutes = "0"+intMinutes+":";
  } else {
     minutes = intMinutes+":";
  }

  if (intSeconds < 10) {
     seconds = "0"+intSeconds+" ";
  } else {
     seconds = intSeconds+" ";
  } 

  timeString = hours+minutes
  <CFIF #Attributes.ShowSeconds# eq
"Yes">+seconds</CFIF>
<CFIF #Attributes.ShowAMPM# eq "Yes">+ap</CFIF>;

  Clock.innerHTML = timeString;
<CFOUTPUT>
  window.setTimeout("tick();", #Attributes.Ticks#);
}
</CFOUTPUT>
window.onload = tick;
</SCRIPT>



<CFOUTPUT>
<CFSET USER = CGI.REMOTE_USER>
<cfset Current_time = timeformat(now())>
<cfset hour = hour(now())>
<cfset day = dayofweek(now())>
<cfif hour(now()) lt 6 >
        <DIV ALIGN="center"><h2><b>What are you doing up</B></H2></DIV>
                <H2 ALIGN="center">#UCASE(REMOVECHARS(USER,1,7))#</H2>
   </cfif>                
<cfif hour(now()) GTE 6 and hour(now()) lt 11 >
        <DIV ALIGN="center"><h2><b>Good morning!!!</B></H2></DIV>
                <H2 ALIGN="center">#UCASE(REMOVECHARS(USER,1,7))#</H2>
                <H2 ALIGN="center"><FONT SIZE="4" COLOR="Blue">Quote of the
day</font></FONT></H2>
                </cfif>  
<cfif hour(now()) GTE 11 and hour(now()) LTE 12 >
        <DIV ALIGN="center"><h2><b>Welcome Users</B></H2></DIV> 
                <H2 ALIGN="center">#UCASE(REMOVECHARS(USER,1,7))#</H2>
                <H2 ALIGN="center"><FONT SIZE="4" COLOR="Blue">Quote of the
day</font></FONT></H2>
</cfif>  

<cfif hour(now()) GT 12 and hour(now()) LTE 16>
        <DIV ALIGN="center"><h2><b>Good afternoon!!</B></H2></DIV>
                <H2 ALIGN="center">#UCASE(REMOVECHARS(USER,1,7))#</H2>
                <H2 ALIGN="center"><FONT SIZE="4" COLOR="Blue">Quote of the
day</font></FONT></H2>  
</cfif>  
<cfelseIF  hour(now()) GTE 17>
        <DIV ALIGN="center"><h2><b>Good evening!!</B></H2></DIV>
                <H2 ALIGN="center">#UCASE(REMOVECHARS(USER,1,7))#</H2>
                <H2 ALIGN="center"><FONT SIZE="4" COLOR="Blue">Quote of the
day</font></FONT></H2>
</cfif>  
</CFOUTPUT>




Dana E. Johnson
Sr. Web Developer
CIT
VTF/Technology Financing Services
[EMAIL PROTECTED]
(904) 620-7458



-----Original Message-----
From: Cami Lawson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 10:50 AM
To: CF-Talk
Subject: Continuous Clock


I have a display clock that shows the time the user accessed the page but
now they want a clock that shows the current time continuously.  I have
figured out countdown timers but is there an easy way to display the current
time continuously?

TIA
cami
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to