我的日期格式是 dd/mm/yyyy 并计算这种格式
这里有一个脚本
<script type="text/javascript">
function GetDays() {
var dropdt = new Date(document.getElementById("sdate").value);
var pickdt = new Date(document.getElementById("edate").value);
var difference = edate - sdate;
return Math.round(difference / 1000 * 3600 * 24);
}
function cal() {
document.getElementById("numdays2").value = GetDays();
}
</script>