Ver Mensaje Individual
  #14 (permalink)  
Antiguo 08/09/2009, 20:45
Avatar de huesos52
huesos52
Colaborador
 
Fecha de Ingreso: febrero-2009
Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 15 años, 3 meses
Puntos: 360
Respuesta: Formato de fecha

sigue las siguientes instrucciones para convertir todas las fechas a timestamp.

Código mysql:
Ver original
  1. mysql> create table unix_t(fecha int(11));
  2. Query OK, 0 rows affected (0.05 sec)
  3.  
  4. mysql>  insert into unix_t values(1221990317);
  5. Query OK, 1 row affected (0.05 sec)
  6.  
  7. mysql> select from_unixtime(fecha) from unix_t;
  8. +----------------------+
  9. | from_unixtime(fecha) |
  10. +----------------------+
  11. | 2008-09-21 04:45:17  |
  12. +----------------------+
  13. 1 row in set (0.00 sec)
  14.  
  15. mysql> alter table unix_t modify fecha varchar(80);
  16. Query OK, 1 row affected (0.11 sec)
  17. Records: 1  Duplicates: 0  Warnings: 0
  18.  
  19. mysql> update unix_t set fecha=cast(from_unixtime(fecha) as char);
  20. Query OK, 1 row affected (0.05 sec)
  21. Rows matched: 1  Changed: 1  Warnings: 0
  22.  
  23. mysql> select *from unix_t;
  24. +---------------------+
  25. | fecha               |
  26. +---------------------+
  27. | 2008-09-21 04:45:17 |
  28. +---------------------+
  29. 1 row in set (0.00 sec)
  30.  
  31. mysql> alter table unix_t modify fecha timestamp;
  32. Query OK, 1 row affected (0.02 sec)
  33. Records: 1  Duplicates: 0  Warnings: 0
  34.  
  35. mysql> select *from unix_t;
  36. +---------------------+
  37. | fecha               |
  38. +---------------------+
  39. | 2008-09-21 04:45:17 |
  40. +---------------------+

siguiendo estas instrucciones (con tus tablas) tendrás las fechas correctas en formato timestamp y legibles para todos los usuarios.

espero te sirva.
__________________
Without data, You are another person with an opinion.
W. Edwads Deming