javascript - Minimum and maximum date -


i wondering minimum , maximum date allowed javascript date object. found minimum date 200000 b.c., couldn't reference it.

does know answer? hope doesn't depend on browser.

an answer in "epoch time" (= milliseconds 1970-01-01 00:00:00 utc+00) best.

from the spec, §15.9.1.1:

a date object contains number indicating particular instant in time within millisecond. such number called time value. time value may nan, indicating date object not represent specific instant of time.

time measured in ecmascript in milliseconds since 01 january, 1970 utc. in time values leap seconds ignored. assumed there 86,400,000 milliseconds per day. ecmascript number values can represent integers –9,007,199,254,740,992 9,007,199,254,740,992; range suffices measure times millisecond precision instant within approximately 285,616 years, either forward or backward, 01 january, 1970 utc.

the actual range of times supported ecmascript date objects smaller: –100,000,000 days 100,000,000 days measured relative midnight @ beginning of 01 january, 1970 utc. gives range of 8,640,000,000,000,000 milliseconds either side of 01 january, 1970 utc.

the exact moment of midnight @ beginning of 01 january, 1970 utc represented value +0.

the third paragraph being relevant. based on paragraph, can precise earliest date per spec new date(-8640000000000000), tuesday, april 20th, 271,821 bce (bce = before common era, e.g., year -271,821).


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -