new Date() takes an ordinal and returns a Date object.
What does Date() do, and how come it gives a different time?
>>> new Date(1329429600000)
Date {Fri Feb 17 2012 00:00:00 GMT+0200 (القدس Standard Time)}
>>> Date(1329429600000)
"Tue Mar 06 2012 15:29:58 GMT+0200 (Jerusalem Standard Time)"
From the specs:
and:
So,
new Date(...)returns an object such thatobj instanceof Dateis true, whereasDate(...)basically returns the same asnew Date().toString().