this script works perfectly only the problem coming is
1. from date in javascript should be auto today's date
2. if days are more than 30 instead of D it should pass dynamically M in input t1
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
var d1 = new Date("09/23/2019");
var d2 = new Date("09/28/2019");
var time = d2.getTime() - d1.getTime();
var days = time / (1000 * 3600 * 24);
$("#lblDays").html("Number of Days between <br/>" + d1 + " <br/>" + d2 + "<br/><b>" + days);
$("#hfDays").val(days);
});
</script>
<input type="hidden" name="p1" value="1" id="hfDays" />
<input type="hidden" name="t1" value="D">
please advice