两个日期之间的月份差异,计算月份的最后日期

month difference between two dates counting lastdate of month

本文关键字:日期 计算 最后 之间 两个      更新时间:2023-09-26

如何使用javascript或jQuery查找两个日期之间的月份差异,计算月份的最后一个日期。

例如:

01/03/2015 - 31/03/2015 - Month: 1
01/03/2015 - 30/03/2015 - Month: 0

使用javascript Date:getMonth()方法:

Date startDate = "01/03/2015";
var startMonth = startDate.getMonth(); 

更多信息请点击此处