get date month year from date in javascript code example
Example 1: js get date day month year
var dateObj = new Date();
var month = dateObj.getUTCMonth() + 1;
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
newdate = year + "/" + month + "/" + day;
Example 2: js get day month year
const d = new Date();
d.getMonth() + 1;
d.getDate();
d.getFullYear();
Example 3: get current month of year in number javascript
var today = new Date();
var month = today.getMonth();
console.log(month);