Curiosidades sobre TIMESTAMP en MySQL

Interesante lo que descubre uno sobre el TIMESTAMP en MySQL:

  • Por defecto TIMESTAMP es NOT NULL, insertar un NULL hace que se almacene el DATETIME actual
  • TIMESTAMP puede tener un valor entre ‘1970-01-01 00:00:01′ y ‘2038-01-19 03:14:07′
  • Solo la primera columna con NOT NULL puede tener por defecto la propiedad CURRENT_TIMESTAMP
  • Cuando CURRENT_TIMESTAMP se indica como ON UPDATE esa columna no se actualiza si no hay cambios significativos (por ejemplo al hacer dos updates iguales)

Interesting things about TIMESTAMP data type in MySQL

Similar Posts