1
rated 0 times
[
8]
[
7]
/ answers: 1 / hits: 27568
/ 14 Years ago, sat, november 27, 2010, 12:00:00
I am trying this but is not working... why?
<html>
<body>
<script type=text/javascript>
var today=new Date(); //today is Nov 28, 2010
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
document.write(today+ );
var today2 = new Date(November 28, 2010);
document.write(today2 + );
if (today == today2) { document.write(==);
if (!(today > today2) && !(today < today2) ) {document.write(== );}
if (today > today2) { document.write(> );}
if (today >= today2 ){ document.write(>= );}
if (today < today2 ) { document.write(< );}
if (today <= today2 ){ document.write(<= );}
</script>
</body>
</html>
And I always get this:
Sun Nov 28 2010 00:00:00 GMT+0900 (JST) Sun Nov 28 2010 00:00:00 GMT+0900 (JST) > >=
Aren't both dates to be the same? Hence, I should get ==
printed but is not happening... ;(
Thank you for your help in advance.
More From » javascript