I have this chunk of code written using PHP
<?php
$dateTime = "$review->published_at";
$dateTimeSplit = explode(" ",$dateTime);
$date = $dateTimeSplit[0];
echo date('d M Y',strtotime($date));
?>
I am trying to write the above with JS and this is what I have so far
var dateTime = review.published_at;
var dateTimeSplit = dateTime.split(" ");
var date = dateTimeSplit[0];
It's not complete, since I have no idea how to write this line with JS
echo date('d M Y',strtotime($date));
Any help?
Edit:
Right now the date is '2017-11-10'. I need it to be '11 Nov 2017'.