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 Add Time Quickly
You don't need superpowers or a calculator to manage your time. There's an easy trick that uses basic math without conversion to...
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 Calculate Time Clock Hours
It is always a good idea to keep track of your own hours, but adding and subtracting with time is a bit...
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...
How to Add the Date & Time to a Web Page
While not an HTML function, date and time can be added to a Web page with Google Gadgets. Add the date and...