The code below shows the day, month and year as:
6
3
116
Which is obviously wrong dates.
var date= new Date();
var day=date.get
Encoding in javascript for months from is 0-11 (not 1-12).
For year, you could use getFullYear() instead of getYear()
"Date.prototype.getFullYear() Returns the year (4 digits for 4-digit years) of the specified date according to local time."
See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date