i have a html form where i will enter a date after that this date will be saved in my database (mongodb) , the problem is that the date in data becames with hours,
fo example from "1993-12-12T00:00:00.000Z" to "1993-12-12"
please help me in this
<form action="/adddoctor" method="POST" class="form-horizontal" role="form" >
<input type="date" class="form-control" min="15/12/1980" max="15/12/1993" name="date_birth" id="date_birth" placeholder="Date de naissannce *" value="" required />
</form>
app.post('/adddoctor', function (req,res) {
var usermed = new users ( {
date_birth:req.body.date_birth,
}
);
usermed.save( function (err) {
if (err) {
console.log(err)
res.send("error")
}
res.sendFile(__dirname + "/public/adddoctor.html");
});
})
This is my nodejs and html code :