0
I am trying to send data from a registration form via Ajax/javascript to a java service, but the database receives the data in date format and I do not know what I should do to convert to date, how do I perform this conversion?
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);
}
});
}