MySQL database has date field which contents date format as 2016-02-28 02:11:24. Following php code and j-query displays date on bootstrap model. I want to change the date format as 28 Feb 2016, 02:11 PM How to do it using front end J-query or back end MySQL field format?
<?php
foreach ($value as $value2) {
echo "<div class='well'>";
echo '<p class="target" userRegdate = "' . $value2->added_date . '" >' . $value2->content . '</p>';
echo "</div>";
}
?>
J-query dialog box to display date
//Display dialog box when mouse click
$(".target").click(function () {
var publish_date = $(this).attr("userRegdate");
BootstrapDialog.show({
title: 'user added date',
message: publish_date
});
});
momentjslibrary: momentjs.com/docs