I was trying out http://www.epochconverter.com/ and I can do year 100, but when I go to year 99, it seems to break down and report 1999 instead of 0099. Is this a bug? How far back is epoch time supposed to be able to represent.
I also tried plugging in MIN_LONG+1 to joda-time which reported -292275055-05-16T16:47:04.192Z so basically year -292275055 which sounds a bit more correct than 1999 and epochconverter.com can't even parse the min long.
What is the minimum value of epoch time allowed? Can I use min long?
thanks, Dean
In theory, there is no limit. "Epoch time" is simply the number of seconds before/after a defined point in time (Jan 1 1970, midnight GMT); with a sufficiently wide numeric type, you can describe any time in these terms.
In practice, such a time value becomes meaningless beyond certain limits:
A signed 32-bit integer has a minimum value of about -2 billion, corresponding to a date in late 1901.
If you are using a floating-point type for dates, it will lose resolution beyond some point. Do not use single-precision (32-bit) floats for time values; they have a resolution of about two minutes (128 seconds) for the current date! 64-bit floats are fine for the foreseeable future, though, as they can exactly represent all 32-bit integers.
Time zones were not standardized before 1900 or so, so trying to represent a time before then is an inexact affair.
The Gregorian calendar was not defined before 1582 (and was not used universally until as late as the 1920s!), so trying to use standard date conversion routines on dates that far back will give incorrect results.
Similarly, the Anno Domini ("AD") calendar was not defined until 525 AD. Additionally, note that there is no year 0.
Some libraries may have other arbitrary limits or restrictions. For instance, the one you're running into here is that the Javascript date library assumes that years less than 100 are shorthand for years between 1900 and 1999.