I am trying to parse a timestamp to use in a plot in d3.js but I cannot manage to get it to work. Examples of the timestamp are shown below:
- 2022-02-17 09:52:37.000000
- 2022-02-17 09:54:00.000000
The code that I use to do the parsing is:
`const dateParser = d3.timeFormat("%Y-%m-%d");
data.forEach(function(d) {
d.timestamp = dateParser(d.ts);
});`
Where d.ts is the timestamp
The output I get at the moment is under the form:
0NaN-NaN-NaN
Thanks in advance