Open a blank Notepad, or equivalent, file and enter the following code.
now = new Date();
utctime = now.toGMTString();
document.write(utctime);
Save the file and make sure you use a .js extension.
To call the output of this script enter this code into a block level element such as a
<p> tag which can be styled however you want to control the appearance of the
date.
<p><script type="text/javascript" src="utc.js"></script></p>
It is also possible to write a script that will fetch and display the time for users of your site in their present location, however, due to the ubiquitousness of clocks there is little need to duplicate a timepiece on your screen and waste valuable real-estate.
© copyright htmlHQ.com 2006