- var d_1 = new Date(); //creates a new date object with the current date and time
- console.log(d_1);
- var d_2 = new Date(2018, 11, 24, 10, 33, 30, 0); //year, month, day, hours, minutes, seconds, milliseconds
- console.log(d_2);
- var d_3 = new Date("October 13, 2014 11:13:00");
- console.log(d_3);
- var d_4 = new Date(0);
- console.log(d_4);
- var d_5 = new Date("2015-03-25"); //ISO Dates
- console.log(d_5);
- var d_1 = new Date(); //creates a new date object with the current date and time
- console.log(d_1.toString());
- console.log(d_1.toUTCString());
- console.log(d_1.toDateString());
- var d = new Date(); //creates a new date object with the current date and time
- console.log(d);
- console.log(d.getFullYear()+'/'+d.getMonth()+'/'+d.getDate());
- var d = new Date(); //creates a new date object with the current date and time
- console.log(d);
- d.setFullYear(2004);
- console.log(d);