Open the HTML page where the clock will be inserted in a text editor of your choice by selecting \"File\" and \"Open\" from the toolbar.
var now = new Date()
var h = now.getHours()
var m = now.getMinutes()
var pm = 'PM'
var am = 'AM'
if (m < 10)
m = '0' + m
if (h >= 12)
m = m + pm
if (h < 12)
m = m = am
var time = h + ':' + m
Copy the following code, then paste it between the <BODY> tag, where you want the clock to appear:
var myClock = getCurrentTime()
document.write(\"The time is \" + myClock + \".\")
Select \"File\" and \"Save\" from the toolbar to save your work. Press \"Save\" in the \"Save\" dialog box.
- Photo Credit digital clock image by JoLin from Fotolia.com
How to Insert a Clock on a Web Page
Website authors occasionally need to display the current time on their Web pages. Inserting a clock on a Web page is most...
How to Add Music to a Photo DVD
Making a photo DVD slideshow allows you to view your favorite images away from the computer. You can inject your personal style...
How to Embed a Countdown Timer
Embedding code or objects in your website is a way to provide content and interactivity without having to build it all from...