This code will help u
function todate(){
var d=new Date();
var dat=d.getDate();
var dd = (dat < 10) ? '0' + dat : dat;
var month=d.getMonth()+1;
var mm = (month < 10) ? '0' + month : month;
var yyyy = (new Date().getFullYear()).toString();
var yy = yyyy.substring(yyyy.length, 2)
var todayDate = mm+"-"+dd+"-"+yy;
tdate=todayDate;
curdt = new Date(tdate);
}
Happy coding ... :)
Seshu