Ver Mensaje Individual
  #13 (permalink)  
Antiguo 10/06/2011, 11:01
ogata99
 
Fecha de Ingreso: mayo-2011
Ubicación: Jaén - [Andalucía]
Mensajes: 17
Antigüedad: 13 años, 8 meses
Puntos: 1
Respuesta: Obtener fecha en formato español DD:MM:AAAA

Buff mira si lo pongo de ésta manera no funciona?
<?
$sql_fecha="select fecha from reserva;";
$result=mysql_query($sql_fecha) or die ("nada de nada");

while ($registro = mysql_fetch_array($result))
{

$date=$registro['fecha'];



function fechaesp($date)
{
$dia = explode("-", $date, 3);
$year = $dia[0];
$month = (string) (int) $dia[1];
$day = (string) (int) $dia[2];
$dias = array("dom", "lun", "mar", "mi&eacute;r", "jue", "vie", "s&aacute;b");
$tomadia = $dias[intval((date("w", mktime(0, 0, 0, $month, $day, $year))))];
$meses = array("", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre");
return $tomadia . ", " . $day . " de " . $meses[$month] . " de " . $year;
}

echo fechaesp($registro);
}
?>