This is as low as I can seem to go with javascript date:
var myDate = new Date(0, 0, 1);
myDate.setFullYear("-271800");
alert(myDate);
Anything lower than -271,800 BC throws an invalid date error. Can we go back a million years? Or a billion? Can the date object allow you to describe any date infinitely in the past or future? How might I do something like this?
You should build your own DateTime for that. It's complexity depends on what you want to achieve...if you want to represent only year, then it is just a simple number...if you want to say what date was the last Sunday in 1 200 000 BC, it is more complex...but have on mind that Sundays didn't exist in that year :)...Gregorian calendar that we use now is introduced 1582 AD, Julian calendar 45 BC (and I'm not sure what was before that). I don't think that even javascript DateTime takes into account that, so setting it to year 271800 BC doesn't make sense.
Representing a particular date a million years ago strikes me as meaningless. Julian calendar? Should days of week honor the Babylonian system?
Create your own type for this, decide what you actually need to represent.
--- Updated: This was accepted, so I'll add a few more specific bits. ---
As mentioned in another answer, according to the EcmaScript spec, pg 164 of the fifth edition (link is a .pdf.)
But, this is for theoretical dates. It ignores a few pieces of reality. Days were shorter (by 12 seconds) a million years ago, so some JavaScript math would be inaccurate. Days of the week have been determined with different systems. Months have been defined differently. All to say, decide what you really need to represent.
The ECMAScript standard requires the Date object to be able to represent any date and time, to millisecond precision, within 100 million days before or after 1/1/1970. This is a range of plus or minus 273,785 years. In order to represent dates outside of this range you would need to implement your own date object that did not operate on millisecond resolution.
According to https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date:
Resources are finite and a developer has to make a compromise between storage, performance and range for any given datatype. IMHO the ecmascript range for dates is large enough for any practical matter.