Javascript Generic method to get today’s date.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 221
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>

Comments or Responses

Login to post response