Date.parse() *ALREADY* is giving you the milliseconds since 1/1/1970.
It is handing you simply a *NUMBER*.
It is *NOT* giving you a Date object, so trying to do
date.getTime() is giving you an error.
Time to learn to DEBUG DEBUG DEBUG!
Any good debugger (I prefer Chrome's, for integration and ease of use) would have shown you what was in date1 and date2.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.