I'm using this datepicker in my project, it's already configured as you can see below the DateFormat in the format d / m / Y, but I would like it when I save it in the database it would convert to YMD format, / p>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script><scriptsrc="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<form action="#" method="post">
<input type="text" name="calendario" id="calendario"/>
<input type="submit" value="Enviar">
</form>
<script>
$(function() {
$( "#calendario" ).datepicker({
dateFormat: 'dd/mm/yy',
dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado','Domingo'],
dayNamesMin: ['D','S','T','Q','Q','S','S','D'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb','Dom'],
monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez']
});
});
</script>
<?php
$anos = isset($_POST['calendario']) ? $_POST['calendario'] : '';
echo $anos;
?>