create date from year month day javascript code example
Example 1: js date methods
var d= new Date();
d.getFullYear();
d.getMonth();
d.getDate();
d.getHours();
d.getMinutes();
d.getSeconds();
d.getMilliseconds()
d.getTime();
d.getDay();
d.Date.now();
d.setDate()
d.setFullYear()
d.setHours()
d.setMilliseconds()
d.setMinutes()
d.setMonth()
d.setSeconds()
d.setTime()
Example 2: datetime to date javascript
var currentDate = new Date();
var date = currentDate.getDate();
var month = currentDate.getMonth();
var year = currentDate.getFullYear();
var dateString = date + "-" +(month + 1) + "-" + year;
Example 3: how make date object in jquery from custom date
var formattedDate = new Date("yourUnformattedOriginalDate");
var d = formattedDate.getDate();
var m = formattedDate.getMonth();
m += 1;
var y = formattedDate.getFullYear();
$("#txtDate").val(d + "." + m + "." + y);