Comparing dates in JavaScript
Dates that are stored in Date objects can be compared or sorted via their Unix timestamp.
Dates that are stored in Date objects can be compared or sorted via their Unix timestamp.
The in-built Date() method can generate an accurate UNIX timestamp.
Date and time objects created using the Date() constructor can be output in various formats.