Date 的踩坑
new Date() 使用 date string 返回时间格式不同 有个需求,需要计算两个日期之间包含的月份,实现如下: 1 2 3 4 5 6 7 8 9 10 function getMonth(startDate, endDate) { const endSeconds = new Date(endDate).getTime() / 1000 const startSeconds = new Date(startDate).getTime() / 1000 const SECONDS_IN_A_MONTH