From the spec, §15.9.1.1:

A Date object contains a Number indicating a particular instant in time to within a millisecond. Such a Number is called a time value. A time value may also be NaN, indicating that the Date object does not represent a specific instant of time.

Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC. In time values leap seconds are ignored. It is assumed that there are exactly 86,400,000 milliseconds per day. ECMAScript Number values can represent all integers from –9,007,199,254,740,992 to 9,007,199,254,740,992; this range suffices to measure times to millisecond precision for any instant that is within approximately 285,616 years, either forward or backward, from 01 January, 1970 UTC.

The actual range of times supported by ECMAScript Date objects is slightly smaller: exactly –100,000,000 days to 100,000,000 days measured relative to midnight at the beginning of 01 January, 1970 UTC. This gives a range of 8,640,000,000,000,000 milliseconds to either side of 01 January, 1970 UTC.

The exact moment of midnight at the beginning of 01 January, 1970 UTC is represented by the value +0.

The third paragraph being the most relevant. Based on that paragraph, we can get the precise earliest date per spec from new Date(-8640000000000000), which is Tuesday, April 20th, 271,821 BCE (BCE = Before Common Era, e.g., the year -271,821).

Answer from T.J. Crowder on Stack Overflow
Top answer
1 of 5
235

From the spec, §15.9.1.1:

A Date object contains a Number indicating a particular instant in time to within a millisecond. Such a Number is called a time value. A time value may also be NaN, indicating that the Date object does not represent a specific instant of time.

Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC. In time values leap seconds are ignored. It is assumed that there are exactly 86,400,000 milliseconds per day. ECMAScript Number values can represent all integers from –9,007,199,254,740,992 to 9,007,199,254,740,992; this range suffices to measure times to millisecond precision for any instant that is within approximately 285,616 years, either forward or backward, from 01 January, 1970 UTC.

The actual range of times supported by ECMAScript Date objects is slightly smaller: exactly –100,000,000 days to 100,000,000 days measured relative to midnight at the beginning of 01 January, 1970 UTC. This gives a range of 8,640,000,000,000,000 milliseconds to either side of 01 January, 1970 UTC.

The exact moment of midnight at the beginning of 01 January, 1970 UTC is represented by the value +0.

The third paragraph being the most relevant. Based on that paragraph, we can get the precise earliest date per spec from new Date(-8640000000000000), which is Tuesday, April 20th, 271,821 BCE (BCE = Before Common Era, e.g., the year -271,821).

2 of 5
98

To augment T.J.'s answer, exceeding the min/max values generates an Invalid Date.

let maxDate = new Date(8640000000000000);
let minDate = new Date(-8640000000000000);

console.log(new Date(maxDate.getTime()).toString());
console.log(new Date(maxDate.getTime() - 1).toString());
console.log(new Date(maxDate.getTime() + 1).toString()); // Invalid Date

console.log(new Date(minDate.getTime()).toString());
console.log(new Date(minDate.getTime() + 1).toString());
console.log(new Date(minDate.getTime() - 1).toString()); // Invalid Date

🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › date › min or max date
Find the minimum or maximum date using JavaScript - 30 seconds of code
January 6, 2024 - As these functions take an arbitrary number of arguments, we can use the spread operator (...) to pass the dates as individual arguments. const minDate = (...dates) => new Date(Math.min(...dates)); const maxDate = (...dates) => new Date(Math.max(...dates)); const dates = [ new Date('2017-05-13'), new Date('2018-03-12'), new Date('2016-01-10'), new Date('2016-01-09') ]; minDate(...dates); // 2016-01-09 maxDate(...dates); // 2018-03-12
🌐
W3Schools
w3schools.com › jsref › prop_date_min.asp
HTML DOM Input Date min Property
The min attribute specifies the minimum value (date) for a date field.
🌐
W3Resource
w3resource.com › javascript-exercises › javascript-date-exercise-12.php
JavaScript: Minimum date from an array of dates - w3resource
The code defines a JavaScript function named "min_date()" with one parameter 'all_dates', representing an array of date strings. ... It initializes two variables: 'min_dt' to store the minimum date string found so far and 'min_dtObj' to store ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date
Date - JavaScript | MDN
Returns the milliseconds (0 – 999) in the specified date according to local time. ... Returns the minutes (0 – 59) in the specified date according to local time.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-select-min-max-dates-in-an-array-using-javascript
How to Select Min/Max Dates in an Array Using JavaScript? - GeeksforGeeks
July 12, 2025 - The code uses reduce() to iterate through the dates array, comparing two dates (a and b) at a time. It finds: Minimum date (minDate): By keeping the smaller of a and b.
🌐
Bobby Hadz
bobbyhadz.com › blog › javascript-get-max-min-date-in-array-of-objects
Get the Max/Min Date in an Array of Objects in JavaScript | bobbyhadz
Pass the result to the Date() constructor. The Math.min and Math.max functions will return the timestamp of the Min/Max date.
🌐
Mobiscroll
demo.mobiscroll.com › javascript › datetime › min-max-restrictions
Javascript Date & Time Min & max values Example | Mobiscroll
Besides invalidating selection that is before and after a specific date, the minimum and maximum allowed length of a range selection can be enforced through the minRange and maxRange options. Dynamically switching between single, multiple or range select can be done with option changes. Looking for more range picker? Learn how to customize range selection → ... JS date object - a common way of passing a date is through a Date object: new Date(1995, 11, 17, 15, 24) (make sure to not simply pass a date string to new Date())
Find elsewhere
🌐
W3Schools
w3schools.com › jsref › prop_datetime_min.asp
HTML DOM Input Datetime min Property
The min attribute specifies the minimum value (date and time) for a datetime field.
🌐
Plain English
plainenglish.io › home › blog › javascript › how to get the min and max dates in a javascript date array?
How to Get the Min and Max Dates in a JavaScript Date Array?
March 23, 2023 - Then we pass in the returned timestamp into the Date constructor to recreate them as dates. ... We can use the Math.max and Math.min methods to get the max and min dates respectively.
🌐
Day.js
day.js.org › docs › en › get-set › min
Minimum · Day.js
dayjs.extend(minMax) dayjs.min(dayjs(), dayjs('2018-01-01'), dayjs('2019-01-01')) dayjs.min([dayjs(), dayjs('2018-01-01'), dayjs('2019-01-01')])
🌐
Mobiscroll
demo.mobiscroll.com › jquery › datetime › min-max-restrictions
JQuery Date & Time Min & max values Example | Mobiscroll
Besides invalidating selection that is before and after a specific date, the minimum and maximum allowed length of a range selection can be enforced through the minRange and maxRange options. Dynamically switching between single, multiple or range select can be done with option changes. Looking for more range picker? Learn how to customize range selection → ... JS date object - a common way of passing a date is through a Date object: new Date(1995, 11, 17, 15, 24) (make sure to not simply pass a date string to new Date())
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Reference › Elements › input › date
<input type="date"> - HTML | MDN
The step base is min if specified, value otherwise, or 0 (the Unix epoch, 1970-01-01) if neither is provided. For date inputs, the value of step is given in days and is treated as a number of milliseconds equal to 86,400,000 times the step value (the underlying numeric value is in milliseconds).
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › getMinutes
Date.prototype.getMinutes() - JavaScript | MDN
const birthday = new Date("March 13, 08 04:20"); console.log(birthday.getMinutes()); // Expected output: 20 ... An integer, between 0 and 59, representing the minutes for the given date according to local time.
🌐
Reddit
reddit.com › r/learnjavascript › how to get minimum date from array of object
r/learnjavascript on Reddit: How to get minimum date from array of object
October 25, 2021 -

Hello,

I would like to get the minimum date of this array of objects bellow:

let activities = [
  { title: 'Hiking', date: '2019-06-13' },
  { title: 'Shopping', date: '2019-06-10' },
  { title: 'Trekking', date: '2019-06-22' },
  { title: 'Trekking', date: null }
]

let sortedActivities = activities.sort((a, b) => new Date(a.date) - new Date(b.date))
console.log(sortedActivities[0])

The problem is when date activities.date is null it always returns null .

What's the best way to reject null value from this comparison ?

Thanks

🌐
W3Schools
w3schools.com › jsref › jsref_getminutes.asp
JavaScript Date getMinutes() Method
cssText getPropertyPriority() getPropertyValue() item() length parentRule removeProperty() setProperty() JS Conversion ... More examples below. getMinutes() returns the minutes (0 to 59) of a date.