[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

what date?



I have this script for a clock and when I put it in my page it comes up with
an error about a date.  Where should I put this date?  and What format
should it look like?  i.e. 960222, 02-22-96, or what?

This is the code for it.  Any help would be appreciated.

Thank you in advance. 
              
                John

<script language="JavaScript">
var timerid = null;
var timerrunning = false;
function stopclock (){
        if(timerrunning)
                cleartimeout(timerid);
        timerrunning = false;
}
function startclock () {
        // make sure the clock is stopped
        stopclock();
        showtime();
}
function showtime () {
        var now = new date();
        var hours = now.gethours();
        var minutes = now.getminutes();
        var seconds = now.getseconds()
        var timevalue = "" + ((hours >12) ? hours -12 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
        timevalue += ((seconds < 10) ? ":0" : ":") + seconds
        timevalue += (hours >= 12) ? " P.M." : " A.M."
        document.clock.face.value = timeValue;
        // you could replace the above with this
        // and have a clock on the status bar:
        // window.status = timeValue;
        timerID = setTimeout("showtime()",1000);
        timerRunning = true;
}
</script>


===============================================================
j o h n  d a i l y

d a l y @ x t c . n e t

z j q d 1 @ a c c e s s . e a s t - t e n n - s t . e d u

http://www.xtc.net/~dalyj/
===============================================================

--------------------------------------------------------------------
This message came from the mailing list javascript. For help using the
mailing list software, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.