Skip to content
Advertisement

html5 date field input is correct but output is reversed

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));
    }
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement