I'm trying to send data from a registration form via Ajax / javascript to a java service, however the database receives the data in date format and I do not know what to do to convert to date, how do I perform this conversion? / p>
function consumir() {
$.ajax({
type: "POST",
url: "http://dalvz/core-web/rest/usuarios",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: true,
data: JSON.stringify({
"nome": document.getElementById('nome').value,
"sobrenome": document.getElementById('sobrenome').value,
"dataNascimento": document.getElementById('dataNascimento').value,
"email": document.getElementById('email').value,
"senha": document.getElementById('senha').value
}),
success: function (data) {
alert(data.nome);
}
});
}