js yesterday date
snippet in javascript

js yesterday date

user948

var d = new Date();
d.setDate(d.getDate() - 1);

js yesterday date

user6431

var yesterday = new Date((new Date()).valueOf() - 1000*60*60*24);