Tema: Sobre fechas
Ver Mensaje Individual
  #11 (permalink)  
Antiguo 19/02/2003, 19:02
Cluster
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
El tipo de dato "TIMESTAMP" de Mysql no es UNIX .. pero si q dispones de la funcion:

UNIX_TIMESTAMP(date)

Y funciones afines para trabajar con TIMESTAMP de UNIX en Mysql.

Cita:
UNIX_TIMESTAMP(date)
If called with no argument, returns a Unix timestamp (seconds since '1970-01-01 00:00:00' GMT) as an unsigned integer. If UNIX_TIMESTAMP() is called with a date argument, it returns the value of the argument as seconds since '1970-01-01 00:00:00' GMT. date may be a DATE string, a DATETIME string, a TIMESTAMP, or a number in the format YYMMDD or YYYYMMDD in local time:
mysql> SELECT UNIX_TIMESTAMP();
-> 882226357
mysql> SELECT UNIX_TIMESTAMP('1997-10-04 22:23:00');
-> 875996580

When UNIX_TIMESTAMP is used on a TIMESTAMP column, the function will return the internal timestamp value directly, with no implicit ``string-to-unix-timestamp'' conversion. If you pass an out-of-range date to UNIX_TIMESTAMP() it will return 0, but please note that only basic checking is performed (year 1970-2037, month 01-12, day 01-31). If you want to subtract UNIX_TIMESTAMP() columns, you may want to cast the result to signed integers. See section 6.3.5 Cast Functions.
fuente:
http://www.mysql.com/doc/en/Date_and...functions.html

Un saludo,