![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
27/01/2008, 10:50
|
| | Fecha de Ingreso: septiembre-2007
Mensajes: 318
Antigüedad: 17 años, 4 meses Puntos: 1 | |
conversion de fecha hola amigos necesito q me ayuden en algo, necesito mostrar un grupo de datos consultados de mi bd y los datos contienen fecha pero las fechas las necesitos en español osea en formato dia/mes/año
los estoy haciendo de esta manera:
$busca=mysql_query("SELECT pa.nombre,pa.apellido,citas.turno,citas.fecha
FROM citas,pa
WHERE citas.idcitas='$idcitas'
AND pa.idpa=citas.idpa ",$conexion);
if($row = mysql_fetch_array($busca)){
$fecha=$row['fecha']; ESTA FUNSION ME HACE LA CONVERSION A ESPAÑOL
function f_datef($fecha) {
$year=substr($fecha,0,4);
$month=substr($fecha,5,2);
$day=substr($fecha,8,2);
$fecha=$day."-".$month."-".$year;
return ($fecha);
}
echo "<tr>";
echo "<td>".$row['nombre']."</td>";
echo "<td>".$row['apellido']."</td>";
echo "<td>".$row['turno']."</td>";
echo "<td>". f_datef($fecha)."</td>";
echo "</tr>";
}
OK LA FUNSION TRABAJA PERFECTAMENTE CUANDO SOLO TENGO QUE MOSTRAR UN REGISTRO PERO CUANDO TENGO QUE MOSTRAR UN GRUPO DE REGISTRO CON SUS FECHAS "TODAS DISTINTAS".. ME MUESTRA UNA FECHA PARA TODOS LOS REGISTROS..
ME TOMA SOLO LA PRIEMERA FECHA QUE CONSIGUE Y LA MUSTRA EN TODAS LOS REGISTRO...
PUEDEN DARME UNA MANO CON ESTOY POR FAVOR.
GRACIAS... |