let currentDate = new Date();
let targetDateObj = new Date('2023-09-13');
currentDate.setHours(0, 0, 0, 0);
targetDateObj.setHours(0, 0, 0, 0);
const timeDifference = Math.abs(currentDate - targetDateObj);
return Math.ceil(timeDifference / (1000 * 3600 * 24));
03-17
1807
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)