With the html input date
<p class="time">Reisezeitraum:
<input type="date" id="date1" name="date1">-<input type="date" id="date2" name="date2">
</p>
I get this date output by email with the following PHP code:
$date1 = htmlspecialchars($_POST["date1"], ENT_QUOTES, "UTF-8");
$date2 = htmlspecialchars($_POST["date2"], ENT_QUOTES, "UTF-8");
....
$mail -> Body = "
<b>Reisezeitraum:</b> {$_POST['date1']} - {$_POST['date2']}<br>
yyyy/mm/dd instead I would like dd/mm/yyyy how can I change this?
I appreciate your help!
I have already tried to replace the PHP code with the following, but unfortunately without success, the format has not changed
$date1 = date_create('01-01-2000');
echo date_format($date1, 'd-m-Y H:i:s');
$date2 = date_create('01-01-2000');
echo date_format($date2, 'd-m-Y H:i:s');
I still got yyyy/mm/dd by mail, in addition the date from this code was displayed on an extra page: PHP