I have this date-time format in my json '2019-12-15T16:00:50.913Z'
how do i turn it into this:
'December 15, 2019, 4:00 PM'
thanks
I have this date-time format in my json '2019-12-15T16:00:50.913Z'
how do i turn it into this:
'December 15, 2019, 4:00 PM'
thanks
You can do it like this:
var dateStr = "2019-12-15T16:00:50.913Z";
var date = new Date(dateStr);
Output: Sun Dec 15 2019 16:00:50 GMT+0000 (Greenwich Mean Time)
It won't output exactly what you said but it will be readable and it's an easy way of doing it.
Further information: https://weblog.west-wind.com/posts/2014/jan/06/javascript-json-date-parsing-and-real-dates#decoding-the-date