J
Jay Dhanji
Hi, I've got a site which uses the javascript below, im using IE 6 SP1
and Windows 2000 SP4, when i launch the html with the javascript, it
brings back the time but doesnt take the DST into consideration. So
basically at the moment, its one hour behind even though in control
panel for DST, it is checked.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TestTime</title>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="GENERATOR" content="Rational Application Developer">
</head>
<body>
<script type="text/javascript">
function Button1_onclick() {
CallBack();
}
function fGetCurrentTime(){
var curDate = new Date();
// Strings to hold bits of time
var curDatehh = curDate.getHours();
curDatehh = curDatehh + "";
var curDatemi = curDate.getMinutes();
curDatemi = curDatemi + "";
if ( curDatehh.length == 1) { curDatehh = "0" + curDatehh }
if ( curDatemi.length == 1) { curDatemi = "0" + curDatemi }
document.getElementById('TimeDisplay').innerText = curDatehh + ":"
+ curDatemi;
}
</script>
<table width="100">
<tr>
<td style="font-size:larger" id="TimeDisplay"><b>NOT SET</
b></td>
</tr>
<tr>
<td>
<input id="UpdateTime" type="button"
value="UpdateTime" language="javascript" onclick="return
fGetCurrentTime();" name="UpdateTime" title="UpdateTime" />
</td>
</tr>
</table>
</body>
</html>
and Windows 2000 SP4, when i launch the html with the javascript, it
brings back the time but doesnt take the DST into consideration. So
basically at the moment, its one hour behind even though in control
panel for DST, it is checked.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TestTime</title>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="GENERATOR" content="Rational Application Developer">
</head>
<body>
<script type="text/javascript">
function Button1_onclick() {
CallBack();
}
function fGetCurrentTime(){
var curDate = new Date();
// Strings to hold bits of time
var curDatehh = curDate.getHours();
curDatehh = curDatehh + "";
var curDatemi = curDate.getMinutes();
curDatemi = curDatemi + "";
if ( curDatehh.length == 1) { curDatehh = "0" + curDatehh }
if ( curDatemi.length == 1) { curDatemi = "0" + curDatemi }
document.getElementById('TimeDisplay').innerText = curDatehh + ":"
+ curDatemi;
}
</script>
<table width="100">
<tr>
<td style="font-size:larger" id="TimeDisplay"><b>NOT SET</
b></td>
</tr>
<tr>
<td>
<input id="UpdateTime" type="button"
value="UpdateTime" language="javascript" onclick="return
fGetCurrentTime();" name="UpdateTime" title="UpdateTime" />
</td>
</tr>
</table>
</body>
</html>