UNIX Timestamp to MySQL DATETIME
- by Henk Denneboom
Hi all,
I have a table with statistics and a field named time with Unix Timestamps.
There are about 200 rows in the table, but I would like to change the Unix timestamps to MySQL DATETIME.
Without losing the current rows.
What would be the best way to update the Unix Timestamp to MySQL's DATETIME?
The current table:
CREATE TABLE `stats` (
`id` int(11) unsigned NOT NULL auto_increment,
`time` int(11) NOT NULL,
`domain` varchar(40) NOT NULL,
`ip` varchar(20) NOT NULL,
`user_agent` varchar(255) NOT NULL,
`domain_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
So the time (INT) should be a DATETIME field.
Thanks in advance!