Valid XHTML 1.0 Transitional

UTC Script

UTC or Coordinated Universal Time is also known as Greenwich Mean Time or Zulu Time. It can be a useful clock to display, especially if your site contains forums or chats that get visitors from many different time zones. Displaying UTC allows viewers to coordinate meetings by setting them for a UTC time (and then working out what time that is in their own time zone).

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.