If you output data with a timestamp, for example, it will appear in the log like this.
Sun May 30 2021 13:19:06 GMT+0900 (日本標準時)
We want to extract the month, day, and year from this.
However, it is easy.
If you write it like this, you can get it.
console.log(date.getDate()); //returns the date (1-31) console.log(date.getMonth()); //returns one less than the number of months console.log(date.getFullYear()); //returns the year
This is what it looks like. I used the following website as a reference.