Using offset from current date and time ( old script )
<script type="text/javascript">
var day_name=new Array(7);
day_name[0]='Sunday'
day_name[1]=' Monday'
day_name[2]='Tuesday'
day_name[3]='Wednesday'
day_name[4]='Thursday'
day_name[5]='Friday'
day_name[6]='Saturday'
function display_c(){
var refresh=1000; // Refresh rate in milli seconds
mytime=setTimeout('display_ct()',refresh)
}
function display_ct() {
var strcount
var x = new Date();
document.getElementById('ct').innerHTML = x;
var x1=x.toUTCString();// changing the display to UTC string
var gmt=new Date();
var offSet=x.getTimezoneOffset();
gmt.setMinutes(x.getMinutes()+offSet);
document.getElementById('ct1').innerHTML = gmt.getHours() + ":" +gmt.getMinutes() + ":" + gmt.getSeconds();
//////////////////////////
function city_zone(offSet){
var t1=new Date();
var offSet1=t1.getTimezoneOffset();
t1.setMinutes(t1.getMinutes()+offSet1); // arrive at GMT tme
t1.setMinutes(t1.getMinutes()+offSet); // add the city time offset
var str=t1.getMonth() + 1;
return t1.getHours() + ":" +t1.getMinutes() + ":" + t1.getSeconds() + " <i>Day:</i> " + day_name[t1.getDay()] + ", <i>Date :</i> " + t1.getDate() + " <i>Month :</i> " + str;
}
//////////////////
// Go for different City time ///
document.getElementById('ct2').innerHTML = city_zone(-420); // Arizona
document.getElementById('ct3').innerHTML = city_zone(-480); // California
document.getElementById('ct4').innerHTML = city_zone(600); // New South Wales
tt=display_c();
}
</script>