Javascript function to get curent date

Here is the implementation of javascript function returning the current date in dd-mmm-yyyy format

[javascript]
function getCurDate(){
var months = new Array(“Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”, “Jul”, “Aug”, “Sep”, “Oct”, “Nov”, “Des”);
var myDate = new Date();

return myDate.getDate() + ‘-’+ months[myDate.getMonth()] + ‘-’ + myDate.getFullYear() ;
}
[/javascript]
Hope it helps!