I have the following input:
<p>Data Saída:</p>
<input type="date" maxlength="10" id="saida" name="saida" value="29/01/2016"/>
It is being displayed as follows:
But I want to display your value and not the dd / mm / yyyy
I solved the problem following certain code:
$data_formatada = DateTime::createFromFormat('d/m/Y', $DtSaida);
<input type="date" maxlength="10" onkeypress="return dateMask(this, event);" id="saida" name="saida" value="<?php echo $data_formatada->format('Y-m-d'); ?>"/>
To do this, simply add the contents of the $ DtSaida variable to the YYYY-MM-DD format, see the example below:
<p>Data Saída:</p><input type="date" maxlength="10" id="saida" name="saida" value="2016-01-16"/>
Considering your result you need to remove the print minutes so try something similar to this: echo
<p>Data Saída:</p><input type="date" maxlength="10" onkeypress="return dateMask(this, event);" id="saida" name="saida" value="<?php date_format($DtSaida, 'Y-m-d'); ?>"/>