if have the following problem. in my html5 datefield, i have the input order dd.mm.yyyy (for example todays date: 27.04.2017).
<input type="date" />
thats correct in my country and timezone. the posted value is in reversed order to my input. its yyyy-mm-dd (for example todays date: 2017-04-27).
is there any way to change the timeformat if the the value is posted?
ive found several solutions but only for the input and not the posted values.
Advertisement
Answer
I’m not really sure what you mean but here is something you can try
$time = strtotime($_POST['dateInput']); if ($time != false) { $mydate = date('d-m-Y', $time)); }