I am pulling the creation date out of an object, and receiving it like this:
2021-04-24T05:48:50.650397026Z
How can I turn it into this?: 24.04.2021, 05:48:50
The current date is stored in firstDate
. Only vanilla JS please, any help is appreciated <3
async function getDate(image, tag) {
return fetch('/registry/v2/' + image + '/manifests/' + tag)
.then(response => response.json())
.then(data => JSON.parse(data.history[0].v1Compatibility).created)
const firstDate = await getDate(imageName, tags[0]);
console.log(firstDate); // output is 2021-04-24T05:48:50.650397026Z