01/01/2011 o 02/01/2011
me las guarda del año anterior es decir:
01/01/2010 o 02/01/2010
Pero las fechas superiores al dia 03/01/2011 las guarda bien en la base de datos.
Alguien sabe a que se debe este problema.
Algo tan simple como:
Código :
<s:Button x="46" y="101" label="Registrar" id="registrar_btn" click="registrar_btn_clickHandler(event)"/>
<mx:DateField x="85" y="56" id="fecha_txt" formatString="DD/MM/YY"/>
<s:Label x="45" y="60" text="Fecha"/>
protected function getAllFechaResult_resultHandler(event:ResultEvent):void
{
fechasistema_v = event.result as Date;
var horarios:Horarios = new Horarios();
horarios.fechasistema = fechasistema_v;
var fecha:Date = fecha_txt.selectedDate;
Alert.show("anio "+ fecha.fullYear);
horarios.fechaseleccionada = fecha;
horarios.comentario = 'dias 1 y 2 de cada anio fallan.';
createHorariosResult.token = horariosService.createHorarios(horarios);
}
El metodo php que utilizo
public function createHorarios($item) {
$stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename (fechasistema, fechaseleccionada, comentario) VALUES (?, ?, ?)");
$this->throwExceptionOnError();
mysqli_stmt_bind_param($stmt, 'sss', $item->fechasistema->toString('YYYY-MM-dd HH:mm:ss'), $item->fechaseleccionada->toString('YYYY-MM-dd HH:mm:ss'), $item->comentario);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
$autoid = mysqli_stmt_insert_id($stmt);
mysqli_stmt_free_result($stmt);
mysqli_close($this->connection);
return $autoid;
}
Muchas gracias de antemano!!
