Javascript date object

jonmark

New Member
Display time
How to display the time on your pages. Note that this script is similar to the Time example above, only this script writes the time in an input field. And it continues writing the time one time per second.
<html>
<body>
<script type="text/javascript">
var timer = null

function stop()
{
clearTimeout(timer)
}

function start()
{
var time = new Date()
var hours = time.getHours()
minutes=((minutes < 10) ? "0" : "") + minutes
var seconds = time.getSeconds()
seconds=((seconds < 10) ? "0" : "") + seconds
var clock = hours + ":" + minutes + ":" + seconds
document.forms[0].display.value = clock
timer = setTimeout("start()",1000)
}
</script>
</body>
</html>
 

CaldwellYSR

Member
That doesn't set it for a specific time zone though does it? That will just output the client time zone. I'm wanting to show the client time zone and a specific time zone at the same time...
 
Top