I have a script that gets a date/time in the the format of:
2017-06-15 21:00
and then converts it to local time and displays as:
If you can use an external library, I'd suggest this one liner using momentjs:
moment('2017-06-15 21:00').format('ffffd MMM DD YYYY h:mm:ss A') // => "Thu Jun 15 2017 9:00:00 PM"