How to subtract days from a plain Date?

 

 subtract days from Date?

var d = new Date();

document.write('Today is: ' + d.toLocaleString());

d.setDate(d.getDate() - 5);

document.write('<br>5 days ago was: ' + d.toLocaleString());

Tags:

Share:

Related posts