i want to display current date and time of client side in the page. i have the javascript code also bt i dnt know how to use it in the page. the code is
Expand|Select|Wrap|Line Numbers
- function ShowTime()
- {
- var TimerKey
- var now = new Date()
- var Hours = now.getHours()
- var Minutes = now.getMinutes()
- var Seconds = now.getSeconds()
- TimeDisplay.innerText = ((Hours > 12) ? Hours - 12 : Hours) + ((Minutes < 10) ? ":0" : ":") + Minutes + ((Seconds < 10) ? ":0" : ":") + Seconds + ((Hours > 12) ? " PM" : " AM")
- window.status = ((Hours > 12) ? Hours - 12 : Hours) + ((Minutes < 10) ? ":0" : ":") + Minutes + ((Seconds < 10) ? ":0" : ":") + Seconds + ((Hours > 12) ? " PM" : " AM")
- TimerKey = setTimeout("ShowTime()",1000)
- }
please give me the instruction to use it