JSFiddle - React, Tailwind, and code Playground

by Trevor W

JavaScript

let foo = "2020-03-02T08:54:37.000Z";


let d = new Date(foo);

console.log(d.getFullYear()+"-"+(d.getMonth()+1)+"-"+(d.getDay()+1));

/* "2020-03-10" */


console.log(foo);