I have to show the format D-M-Y
but it must be saved in the MySQL database, Y-M-D
. I am using Bootstrap for the calendar of dates and PHP to perform the maintenance on the table.
Code HTML and PHP :
<div class="form-group">
<label class="control-label col-xs-3">Fecha Inicio :</label>
<div id="datetimepicker1" class="col-xs-3 input-group">
<input data-format="yyyy-MM-dd" type="text" class="form-control" id="fecIni" name="fecIni" ></input>
<span class="input-group-addon add-on">
<i data-time-icon="fa fa-times" data-date-icon="fa fa-calendar" ></i>
</span>
</div>
</div>
At the moment I modified the data-format
to dd-mm-yyyy , yes, I visualize this format, but I get an error when saving and it is because of the format type entered.
However, when I remove the data-format
it is also displayed in dd-mm-yyyy format, but it can not be saved.
For maintenance I use Stores Procedures and the date is declared as DATETIME
.