R
Russ Chinoy
Has anyone ever noticed that getTime() returns the same value for both today
(5/31/2005) and tomorrow (6/1/2005)?
You can quickly see it with this page:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script>
function DoIt() {
today = new Date(2005,5,31);
tomorrow = new Date(2005,6,1);
alert('today=' + today.getTime() + '\ntomorrow=' + tomorrow.getTime());
}
</script>
</head>
<body>
<a href="#" onClick="DoIt()">Click me</a>
</body>
</html>
This bug is present in Firefox 1.0.4, IE 6.0, and Netwscape 7.1 (the three
browsers I have on my machine). It appears to be year-independent, but some
other month boundaries produce the same problem (such as 3/31 and 4/1).
Anyone have a workaround for this? It's causing problems where I'm trying to
compare dates.
Thanks,
Russ Chinoy
(5/31/2005) and tomorrow (6/1/2005)?
You can quickly see it with this page:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script>
function DoIt() {
today = new Date(2005,5,31);
tomorrow = new Date(2005,6,1);
alert('today=' + today.getTime() + '\ntomorrow=' + tomorrow.getTime());
}
</script>
</head>
<body>
<a href="#" onClick="DoIt()">Click me</a>
</body>
</html>
This bug is present in Firefox 1.0.4, IE 6.0, and Netwscape 7.1 (the three
browsers I have on my machine). It appears to be year-independent, but some
other month boundaries produce the same problem (such as 3/31 and 4/1).
Anyone have a workaround for this? It's causing problems where I'm trying to
compare dates.
Thanks,
Russ Chinoy