javascript = new Date( code example
Example 1: new date javascript
let today = new Date();
let birthday = new Date("December 17, 1995 03:24:00");
let birthday = new Date("1995-12-17T03:24:00");
let birthday = new Date(1995, 11, 17);
let birthday = new Date(1995, 11, 17, 3, 24, 0);
let birthday = new Date(628021800000);
let [month, date, year] = new Date().toLocaleDateString("en-US").split("/");
let [hour, minute, second] = new Date()
.toLocaleTimeString("en-US")
.split(/:| /);
let date = new Date(98, 1);
date.setYear(98);
date.setFullYear(98);
Example 2: javascript date
var d= new Date();
d.getFullYear();
d.getMonth();
d.getDate();
d.getHours();
d.getMinutes();
d.getSeconds();
d.getMilliseconds();
d.getTime();
Example 3: javascript date
var currentDate = new Date();
var dateFromTimeStamp= new Date(1560807962);
var dateFromString = new Date('December 17, 1995 03:24:00');
var dateFromYearMonthDay = new Date(2018, 11, 26, 0, 0, 0, 0);
Example 4: new date() javascript
var date = new Date();
var date = new Date(year, month, day, hours, minutes, seconds, milliseconds);
Example 5: new date javascript
let local_date = new Date();
alert("it is " + local_date + "!")