Home   |  Viewing problem solution  |  About me


 

JavaScript

 
When people view your Web page, they are more concerned about the time of the day where they are than the time of the day where your Web page is located. If you add the time to your Web page via a CGI program, you will have a hard time converting your time to the local time of your Web users. Fortunately, JavaScript can be easily used to display the user's local time and identify the user's time-zone offset from Greenwich Mean Time (GMT). Here is the script written in JavaScript scripting language, that you can use in your Web page, for free. The output of the code will be as shown below:
 

Output of the code:    

   

Follow the steps, written below in order to implement above code in your HTML page.

  1. Select the code by clicking on the Select Code button.
  2. Press Ctrl+C or select Edit > Copy from your browser window.
  3. Go to Start > Accessories > Notepad.
  4. Press Ctrl+V or select Edit > Paste from Notepad's Menu Bar.
  5. Save the file with name "wc.txt" (because, if accidentally you delete the code from HTML page, you could retrieve it from this file).
  6. Now paste the code of the file wc.txt within any page where you want to put online world clock.

All rights reserved. Copyright © 1999 - . Krishna Kumar Khatri.
Best viewed with Microsoft IE 6 or later, under 800x600 resolution with True Color (24-bit).