Ver Mensaje Individual
  #11 (permalink)  
Antiguo 25/02/2008, 11:54
Avatar de Henki
Henki
 
Fecha de Ingreso: febrero-2008
Mensajes: 74
Antigüedad: 16 años, 2 meses
Puntos: 0
Re: Ayuda A Formatiar Una Fecha

Cita:
Iniciado por GatorV Ver Mensaje
Puedes usar algo así:
Código PHP:
echo date"Y/m/d"strtotime$row['fecha'] ) ); 
strtotime, se encarga de transformar una fecha larga en un UNIX TIMESTAMP que luego puedes formatear con PHP.

Saludos.
Voy a probarlo, pero mirando tutoriales me he encontrado con esto:
SQL Function Code:

SELECT DATE(CURRENT_TIMESTAMP); - returns a date (2004-06-22)

SELECT TIME(CURRENT_TIMESTAMP); - returns the time (10:33:11.840)

SELECT DAYOFWEEK(CURRENT_TIMESTAMP); - returns a numeric value (1-7)

SELECT DAYOFMONTH(CURRENT_TIMESTAMP); - returns a day of month (1-31)

SELECT DAYOFYEAR(CURRENT_TIMESTAMP); - returns the day of the year (1-365)

SELECT MONTHNAME(CURRENT_TIMESTAMP);
- returns the month name (January - December

SELECT DAYNAME(CURRENT_TIMESTAMP);
- returns the name of the day (Sunday - Saturday)

SELECT WEEK(CURRENT_TIMESTAMP); - returns number of the week (1-53)

Algunas de ellas, por ejemplo select month, funcionan perfectamente, pero select date, que es justo lo que me interesa, no, me dice que date no es una funcion valida. Es normal?
salu2 y gracias