<pre><code>today1 = new Date();
today2 = Date.parse("2008-28-10");
</code></pre>

<p>To compare the time (millisecond) values of these I have to do the following, because today2 is just a number.</p>

<pre><code>if (today1.getTime() == today2)
</code></pre>

<p>Why is this?</p>

If I remember correctly, Date gives you a value down to the millisecond you created the Date object. So unless this code runs exactly on 2008-28-10 at 00:00:00:000, they won't be the same.
Just an addition: Date.parse() by definition returns a long value representing the millisecond value of the Date, and not the Date object itself. If you want to hold the Date object itself, just build it like so:
```
```
var newDate = new Date();
newDate.setFullYear(2008,9,28);
```
```
For more reference check out:
the Date class reference