Array of world different Time Zones

Return to Time Zone Tutorial
List of timezones is here as an array.
var my_timezones=[
// copy the full code below  ///// 

We can create one drop down list box by using above timezone array.
We can also display the changing clock after selection of timezone from the dropdown list here

Select one time zone

Full code is here, copy and use the my_timezones[] array from below.
for (i=0;i<my_timezones.length;i++)

function addOption(selectbox,text,value )

{var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;

function disp_TZ(){[].value;
str= new Date().toLocaleString("en-NZ", {timeZone: tz,timeZoneName:"short"})
document.getElementById('ct').innerHTML = str + "," + tz;
function display_c(){
var refresh=1000; // Refresh rate in milli seconds

HTML part is here
<span id='ct' style="background-color: #FFFF00">Select one time zone </span>
<form method=post name=f1>
<select name=tz onChange=disp_TZ()>


Adding default time zone

We will assign one default option to the drop down time zone list.
for (i=0;i<my_timezones.length;i++)
If you want the clock to show the default list ( time zone ) value then just call the function before closing the script tag.
disp_TZ() // to show time while loading the page
Copy the full working code including the HTML part from here.
Time Zone Tutorial
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer