Fetching Date of 25 Days Ago to Current Date using Javascript

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 1185
<script type="text/javascript">
function getdates()
{
var today = new Date()
var priorDate = new Date();
priorDate.setDate(priorDate.getDate() - 25) //you can take any value
document.getElementById('lblCurrentDate').innerHTML = today;
document.getElementById('lblPreviousDate').innerHTML = priorDate;
}
</script>

Comments or Responses

Login to post response