javascript datetime get year month day code example
Example 1: how to get only month and year in js
let dateObj = new Date();
let myDate = (dateObj.getUTCFullYear()) + "/" + (dateObj.getMonth() + 1)+ "/" + (dateObj.getUTCDate());
Example 2: javascript get current day of month
new Date().getDate();//gets day of month (1-31)