Javascript Date function

I want to format date using javascript in the form mmm dd yyyy

by Darby Rathbone

HTML

<button id="displayDate">DisplayDate</button>

JavaScript

var month_names_short= ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

var displayDate = function() {
    console.log('working');
    var myDateVariable = (new Date());
    var formatDatevVariable = myDateVariable.toDateString();
    console.log("the current date is " + myDateVariable);
    console.log("The current time after formatting is :" +formatDatevVariable);
    console.log(month_names_short[myDateVariable.getMonth()] + ' ' + myDateVariable.getDate()+ ' ' +myDateVariable.getFullYear());
    /*I want to show the date in the form as mmm dd yyyy for example Apr 05 2014*/
};
console.log((new Date()));
document.getElementById('displayDate').addEventListener('click',displayDate);