Datepicker and DB insert 0000-00-00
Hi all,
strange things are happening here.
The inserted db value related to the datepicker field is always 0000-00-00.
So, I changed the insert db binding value from:
<?php echo ((isset($_POST["data_scontrino_reg"]))?$_POST["data_scontrino_reg"]:""); ?>
to
<?php echo ((isset($_POST["data_scontrino_reg"]))?date('Y-m-d',strtotime($_POST["data_scontrino_reg"])):""); ?>
But now the inserted value is in the wrong format:
yyyy-dd-mm
instead of the required one:
yyyy-mm-dd
AAARHGHHHH!
Please note the datepicker format is specified in the datepicker UI is dd/mm/yyyy.
Can you help me to fix this?
TIA
tony