Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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"
Source by reactgo.com #
 
PREVIOUS NEXT
Tagged: #set #previous #year #current #date #javascript
ADD COMMENT
Topic
Name
2+4 =