adding a method to date class javascript code example
Example 1: javascript date
const d = new Date();
d.getFullYear(); // 2020
d.getMonth(); // October
d.getDate(); // 4
d.getHours(); // 11
d.getMinutes(); // 20
d.getSeconds(); // 12
d.getMilliseconds(); // 0
d.getTime(); // ????????????
Example 2: new date javascript
/*Get date from JS API - Date() class*/
let local_date = new Date();
alert("it is " + local_date + "!")