Date format looks like that: 2020-07-11 23:11:52
I am taking data from csv file using fetch and splitting it into single data
How to change this string (date) into date with time to plot on the chart
async function getData(){
const response =await fetch('data.csv');
const data = await response.text();
const table = data.split('\n').slice(1);
table.forEach(row =>{
const columns = row.split(',');
const date = columns[0];
// const dayshours = date.split(' ');
// const days = dayshours[0];
xlabels.push(date);
const temp = columns[1];
ytemps.push(temp);
console.log(date, temp);
});
}
