获取日期相减总的天数
作者:互联网
获取日期相减总的天数
getDaysByDateString (dateString1, dateString2) {
var startDate = Date.parse(dateString1.replace('/-/g', '/'))
var endDate = Date.parse(dateString2.replace('/-/g', '/'))
var diffDate = (endDate - startDate) + 1 * 24 * 60 * 60 * 1000
var days = diffDate / (1 * 24 * 60 * 60 * 1000)
return days
}
标签:24,startDate,endDate,相减,天数,60,Date,日期,var 来源: https://blog.csdn.net/qq_42580876/article/details/111588397