Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Is there any method to display clock time from server.<HTML><HEAD><TITLE>Clock</TITLE> <SCRIPT> <!-- //Define a couple of global variables. var timerID = null var timerRunning = false function stopTimer(){ //stop the clock if(timerRunning) { clearTimeout(timerID) timerRunning = false } } function startTimer(){ // Stop the clock (in case it's running), then make it go. stopTimer() runClock() } function runClock(){ document.clock.face.value = timeNow() timerID = setTimeout("runClock()",1000) timerRunning = true } function timeNow() { //Grabs the current time and formats it into hh:mm:ss am/pm fo +rmat. now = new Date() hours = now.getHours() minutes = now.getMinutes() seconds = now.getSeconds() timeStr = "" + ((hours > 12) ? hours - 12 : hours) timeStr += ((minutes < 10) ? ":0" : ":") + minutes timeStr += ((seconds < 10) ? ":0" : ":") + seconds timeStr += (hours >= 12) ? " PM" : " AM" return timeStr } // End of custom functions, stop hiding code --> </SCRIPT> </HEAD> <BODY text=#000000 vLink=#cc0000 aLink=#3300ff link=#33ff00 bgColor=#f +fffff onload=startTimer() onunload=stopTimer()><FONT size=+1>Clock</FONT> <P> <CENTER> <P> <FORM name=clock><INPUT size=11 name=face></FORM> <P></P></CENTER></BODY></HTML>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Display clock
by Zaxo (Archbishop) on Sep 14, 2005 at 00:34 UTC | |
by Anonymous Monk on Sep 14, 2005 at 02:50 UTC | |
|
Re: Display clock
by pg (Canon) on Sep 14, 2005 at 04:24 UTC | |
|
Re: Display clock
by chanio (Priest) on Sep 14, 2005 at 19:00 UTC | |
by Anonymous Monk on Sep 15, 2005 at 02:17 UTC |