Answers for "get today and yesterday date in javascript"

3

js yesterday date

var yesterday = new Date((new Date()).valueOf() - 1000*60*60*24);
Posted by: Guest on October-29-2020
1

js date of yesterday

let today = new Date();
let yesterday = new Date();

yesterday.setDate(today.getDate() - 1);

console.log('Today: ' + today);
console.log('Yesterday: ' + yesterday);
Posted by: Guest on December-04-2020

Code answers related to "get today and yesterday date in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language