date toIsoString substring code example
Example 1: js toisostring
new Date().toISOString().slice(0, 16).replace('T', ' ')
// "2020-11-28 00:40"
Example 2: toisodatestring
let isoDate = "2013-03-10T02:00:00Z";
alert(isoDate.split("T")[0]);
new Date().toISOString().slice(0, 16).replace('T', ' ')
// "2020-11-28 00:40"
let isoDate = "2013-03-10T02:00:00Z";
alert(isoDate.split("T")[0]);