There's more than one way to do what you're looking for, if you'd like to keep the value of input with snippets of code, you could do the following:
In your input, create a name property: <input name="data">
In the script where you treat the data coming from the form you can get the data via $_POST['data']
or $_GET['data']
depending on the method chosen to send the form.
At this time, I believe the user entered the date in the d-m-Y format, right? Ok ... You will do something like this to convert to Y-m-d:
$data = new DateTime($_POST['data']);
$dataFormatada = $data->format('Y-m-d')
;
Remembering that from now on you can usually work by putting intervals or whatever you need most and passing the responsibility of formatting the date to the script that handles the form after submission, you clean up your view a bit more and help readability and maintenance later.