I am try to get number of days between two dates. here is my code--
Var first = new Date('2021-09-01T03:24:00');
Var second = new Date('2022-09-02T05:24:00');
Var Difference = second.getdate() - first.getdate();
console.log('Difference day---->' + Difference);
Output:
Difference day---->1 day
But Correct Output:
Difference---->366 days