我想计算两个日期的天数我的日期格式是dd-mmm-yyyy这样的"10-Nov-2020" 有人可以帮我吗?
<script>
var deFromDate;
var deToDate;
var statarr;
function deFromDateChanged(s, e) {
deFromDate = (s.GetInputElement().value)
//statarr = deFromDate.split('-');
}
function deToDateChanged(s, e) {
deToDate = (s.GetInputElement().value)
var Difference_In_Time = deToDate.getTime() - deFromDate.getTime();
var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);
alert(Difference_In_Days);
}
</script>
我收到错误getTime()是否有其他方法可以执行相同操作
三国纷争
aluckdog
相关分类