JavaScript date conversion issues

0

I have a system hosted in UOL where I capture the data through a ajax of my WebService and the dates that are in the database are in the format of DD/MM/AAAA however when I return to the screen ( HTML ) the dates end up being converted to MM/DD/AAAAA .

How can I always get the form DD/MM/AAAAA ?

Follow the code @Lucas Costa

I'm looking for WS information try {         // Request on Server         $ .ajax ({             type: "POST",
            url: method,             date: JSON.stringify (Parameters),

        beforeSend: function(){
            loading.css('visibility', 'visible'); // exibe o div
        },
        complete: function(){
            loading.css('visibility', 'hidden'); // esconde o div
            divLoading.classList.remove('loading');
            divLoading.innerHTML = '';
        },

        cache: false,
        contentType: "application/json", //; charset=utf-8",
        dataType: "json",
        success: function (resposta) {
            if (resposta.d !== null && resposta.d !== "") {
                pagina = 0;                
                dados  = resposta.d;                 
            }  

** After I populate my table

for (var i = 0; i

asked by anonymous 23.03.2017 / 15:01

1 answer

0

JavaScript has its own date pattern, so you need to convert them.

See here, this answer solves your problem:

link

    
24.03.2017 / 20:26