To solve the problem, we will need to use a regex.
The return of $.Ajax()
or $.Post()
will be in a variable as below.
$.post("/Area/Controler/Ação", {parametros}, function (retorno) {
console.log(retorno) // "/Date(123456789)/"
}, "Json");
Then we can take the return variable and convert to date as below
$.post("/Area/Controler/Ação", {parametros}, function (retorno) {
console.log(new Date(parseInt(retorno.replace(/[a-z A-z () /]/g, ""))));
//Fri Jan 02 1970 07:17:36 GMT-0300 (Horário Padrão de Brasília)
console.log(new Date(parseInt(retorno.replace(/[a-z A-z () /]/g, ""))).toLocaleString());
//"02/01/1970 07:17:36"
}, "Json");
If you want to handle this in Javascript, it might help: https://answall.com/a/398489/112052
– hkotsubo