Answers for "set a previous year to the current date in javascript"

0

set a previous year to the current date in javascript

const d = new Date();
d.setFullYear(d.getFullYear()-1);

console.log(d.toDateString()); // "Fri Oct 04 2019"
Posted by: Guest on August-29-2021

Code answers related to "set a previous year to the current date in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language