Java Reference
In-Depth Information
}
function updateTime()
{
var nowTime = new Date();
var resultsText = '<p>Local Time is ' + getTimeString(nowTime) + '</p>';
nowTime.setMinutes(nowTime.getMinutes() + nowTime.getTimezoneOffset() +
parseInt(timeDiff) + daylightSavingAdjust);
resultsText += '<p>' + selectedCity + ' time is ' +
getTimeString(nowTime) + '</p>';
document.getElementById('ConversionResultsDIV').innerHTML = resultsText;
}
function chkDaylightSaving_onclick()
{
if (document.form1.chkDaylightSaving.checked)
{
daylightSavingAdjust = 60;
}
else
{
daylightSavingAdjust = 0;
}
updateTime();
}
</script>
</head>
<body onload=”updateTimeZone()“>
<div id=”ConversionResultsDIV”></div>
<form name=”form1”>
<select size=”5” name=”lstCity” onchange=”updateTimeZone();”>
<option value=”60” selected>Berlin
<option value=”330”>Bombay
<option value=”0”>London
<option value=”180”>Moscow
<option value=”-300”>New York (EST)
<option value=”60”>Paris
<option value=”-480”>San Francisco (PST)
<option value=”600”>Sydney
</select>
<p>
It's summertime in the selected city
and its country adjusts for summertime daylight saving
<input type=”checkbox” name=”chkDaylightSaving”
onclick=”return chkDaylightSaving_onclick()“>
</p>
</form>
</body>
</html>
Search WWH ::




Custom Search