What is the maximum and the minimum date that I can use with the Date object in Javascript?
Is it possible to represent ancient historical dates (like January 1, 2,500 B.C.) or dates that are far into the future (like October 7, 10,000)?
If these far-from-present dates can’t be represented with the Date object, how should I represent them?
According to §15.9.1.1 of the ECMA-262 specification,
So the earliest date representable with the
Dateobject is fairly far beyond known human history:The latest date is sufficient to last beyond Y10K and even beyond Y100K, but will need to be reworked a few hundred years before Y276K.
Any date outside of this range will return
Invalid Date.In short, the JavaScript
Datetype will be sufficient for measuring time to millisecond precision within approximately 285,616 years before or after January 1, 1970. The dates posted in the question are very comfortably inside of this range.