The JavaScript Date object can be used directly in relations, like <, >, <=, ==, etc., and also certain math operations (-, for instance). What happens under the covers is that the Date object's underlying primitive "time" value, which is milliseconds since The Epoch (the same value that you get from the getTime function), is used in the expression.
So:
var d1 = new Date(2010, 0, 1); // January 1st, 2010
var d2 = new Date(2010, 1, 1); // February 1st, 2010
display(d1 < d2); // alerts "true"
display(d1 > d2); // alerts "false"
display(d2 - d1); // alerts "2678400000", the difference in milliseconds
Live example
The above lines are functionally identical to:
var d1 = new Date(2010, 0, 1); // January 1st, 2010
var d2 = new Date(2010, 1, 1); // February 1st, 2010
display(d1.getTime() < d2.getTime()); // alerts "true"
display(d1.getTime() > d2.getTime()); // alerts "false"
display(d2.getTime() - d1.getTime()); // alerts "2678400000", the difference in milliseconds
This information is in the spec, but you really have to cross-reference sections to find it. We start with 11.8.5 ("The Abstract Relational Comparison Algorithm") that tells us the values will be compared using the [[ToPrimitive]] operation with the "hint" Number. Head over to section 9.1 ("ToPrimitive") and it tells us that for Objects, [[ToPrimitive]] just passes through to [[DefaultValue]], passing on the hint. Head over to 8.12.8 ("DefaultValue (hint)") and it tells us if the hint is Number and the object has a valueOf, it'll use valueOf. So check out Date's valueOf (15.9.5.8 ) and it says it returns "this time value" which is the spec's way of saying the number of milliseconds since The Epoch (read the introduction to the Date object [15.9.1, 15.9.1.1] to verify that). Conveniently, the very next section (15.9.5.9) is getTime, which says the same thing.
Whew!
(No, I didn't do all of that just to answer this question; I'd done it a year or so back when I realized I didn't quite know what was going on when I did this, and I got curious.)