js get min date

Solutions on MaxInterview for js get min date by the best coders in the world

showing results for - "js get min date"
Alberto
25 Mar 2016
1let maxDate = new Date(8640000000000000);
2let minDate = new Date(-8640000000000000);
3
4console.log(new Date(maxDate.getTime()).toString());
5console.log(new Date(maxDate.getTime() - 1).toString());
6console.log(new Date(maxDate.getTime() + 1).toString()); // Invalid Date
7
8console.log(new Date(minDate.getTime()).toString());
9console.log(new Date(minDate.getTime() + 1).toString());
10console.log(new Date(minDate.getTime() - 1).toString()); // Invalid Date