I usually treat this data on the server side, and using PHP I do this:
<input type="text" name="minha_data"
id="minha_data" class="form-control data datepicker"
value="<?php data_us_to_br($geral->dt_atendimento); ?>"
placeholder="dd/mm/aaaa" maxlength="10" minlength="10" />
and on the server side, when I get the POST like this:
$valorMinhaData = data_br_to_us($_POST['dt_verificacao']);
and the functions I am using in case are these:
function data_us_to_br($dateUSA)
{
if($dateUSA) {
$ano = substr($dateUSA, 0, 4);
$mes = substr($dateUSA, 5, 2);
$dia = substr($dateUSA, 8, 2);
$dateBR = $dia .'/'. $mes .'/'. $ano;
return $dateBR;
}
return NULL;
}
function data_br_to_us($dateBR)
{
if($dateBR) {
$ano = substr($dateBR, 6, 4);
$mes = substr($dateBR, 3, 2);
$dia = substr($dateBR, 0, 2);
$dateUSA = $ano .'-'. $mes .'-'. $dia;
return $dateUSA;
}
return NULL;
}