I am using react js. I have some json data where I am fetching the timestamp. It has date and time both. For example:
timestamp":"2020-03-23T14:00:00.000Z"
Now after fetching all the json data including timestamp. I wanna make a chart, but I only want to use the date in my chart, not the time. How do I only get the date from the timestamp in the form of 2020/03/23 not the-
but with /
? I am using chartjs
for making the chart Thanks.
Edit:
for (const dataobj of json) {
let tempsymbolsDate = dataobj.timestamp.split("T")[0];
tempsymbolsDate.replace("-", "/"); //here it doesn't replace with `/`
console.log(tempsymbolsDate);
}