For JavaScript, just create a new Date object like this
var currentDate = new Date();
and then you can create the date in any format using the methods that Date provides. See this link for a complete list of methods you can use.
In your case, you can do something like this:
var months = Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); var currentDate = new Date(); var formatedDate = currentDate.getDate() + ' ' + months[currentDate.getMonth()] + ' ' + currentDate.getFullYear() + ' ' + currentDate.getHours() + ':' + currentDate.getMinutes();
As for PHP, it's simple:
$formatedDate = date("c");
See this page for a full reference to the Date() function.
source share