EDITED
You can use this function in your code:
function getFormattedDate(input){ var pattern=/(.*?)\/(.*?)\/(.*?)$/; var result = input.replace(pattern,function(match,p1,p2,p3){ var months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Dec']; return (months[(p1-1)]+" "+p2<10?"0"+p2:p2)+" "+p3; }); alert(result); }
And for reference. you can call this function as follows:
getFormattedDate("11/18/2013");
OR you can also use this code.
var date = new Date(); dateFormat(date,"mediumDate");
You can also find other various formats here.
source share