get the year and day and month from date js code example
Example 1: js get date day month year
var dateObj = new Date();
var month = dateObj.getUTCMonth() + 1; //months from 1-12
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
newdate = year + "/" + month + "/" + day;
Example 2: javascript get current day of month
new Date().getDate();//gets day of month (1-31)