I want to add 90 days to the given start date, So I have this:
const start = new Date('2021-11-15T13:27:16.982Z');
const end = new Date().setDate(start.getDate() + (90));
console.log(getDate(start))
console.log(getDate(end))
function getDate(date) {
return new Date(date).toLocaleDateString('en-US')
}
But As you notice instead of getting 90 days late it returns -2
days!
Why this is happening and how to fix this?