Below generic JavaScript sample code use to return the current date
We will use the format in-built method:- <script type = "text/javascript">
function Get_Today_Date()
{
var dtToday = new Date();
var Crrntday = format(dtToday.getDate());
var Crrntmonth = format(dtToday.getMonth() + 1);
var Crrntyear = format(dtToday.getFullYear());
return Crrntday + "-" + Crrntmonth + "-" + Crrntyear;
}
</script>