Hey there! I have an array of dates that look like this: [2019-02-21T04:06:32.000Z]
. I'm trying to convert these dates into the format [02/21/2019 4:06:32 AM]
using JavaScript's map function.
dateArray.map( x => {
return moment.tz(x, 'Etc/UTC').format('MM/DD/YYYY h:mm:ss A').toString()
});
After running this code, when I console log the date array, it still shows the dates in the original format [2019-02-21T04:06:32.000Z]
, even though inside the map() function they are formatted correctly. Can anyone help me figure out what I'm doing wrong here? Thank you!