get date of javascript code example
Example 1: get date in javascript
function getTodayDate() {
let d = new Date();
return d;
}
console.log(getTodayDate());
//2020-12-06T09:53:14.105Z
Example 2: get date in javascript
document.write(new Date().getFullYear());