Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react get current date minus 7 days

let today = new Date();
today.setDate(today.getDate() - 7);
let date = new Date(today).toLocaleDateString("de");

// e.g. today = 3.02.2021
// date will be "27.01.2021"
 
PREVIOUS NEXT
Tagged: #react #current #date #days
ADD COMMENT
Topic
Name
3+2 =