UNIX Timestamp to MySQL DATETIME

Remember to test it before using it for real, this is written from memory but should give you a good idea.

ALTER TABLE `stats` CHANGE `time` `unix_time` int(11) NOT NULL // rename the old column
ALTER TABLE `stats` ADD `time` DATETIME NOT NULL // create the datetime column
UPDATE `stats` SET `time`=FROM_UNIXTIME(unix_time) // convert the data
ALTER TABLE `stats` DROP `unix_time` // drop the old unix time column

  1. use alter table to create a new column (eg. time2) with the datetime type in the same table
  2. update stats set time2=from_unixtime(time);
  3. use alter table to a) delete the time column, and b) rename the time2 to time.