From the ajax, I am receiving datetime as:
Not sure now to parse it with jquery to "dd/MM/yyyy"
Since you posted your question in the jquery tag, you could embed your approach in a jQuery function:
//returns a Date() object in dd/MM/yyyy $.formattedDate = function(dateToFormat) { var dateObject = new Date(dateToFormat); var day = dateObject.getDate(); var month = dateObject.getMonth() + 1; var year = dateObject.getFullYear(); day = day < 10 ? "0" + day : day; month = month < 10 ? "0" + month : month; var formattedDate = day + "/" + month + "/" + year; return formattedDate; }; //usage: var formattedDate = $.formattedDate(someDateObjectToFormat); This will work with both valid Date objects and the result you get back from your JSON string:
var randomDate = new Date("2015-09-30"); var epochTime = new Date(1263183045000); var jsonResult = "\/Date(1263183045000)\/"; //outputs "30/09/2015" alert($.formattedDate(randomDate)); //both below output "11/01/2010" alert($.formattedDate(epochTime)); alert($.formattedDate(new Date(parseInt(jsonResult.substr(6))))); Aside: the format of the date portion in your result is in Unix time—aka Epoch time—i.e. the number of seconds elapsed after 01/01/1970 00:00:00 UTC.