extract date part from date object in javascript code example
Example 1: js get day month year
const d = new Date();
d.getMonth() + 1; // Month [mm] (1 - 12)
d.getDate(); // Day [dd] (1 - 31)
d.getFullYear(); // Year [yyyy]
Example 2: how to get date time day year in javscript
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();