W
W
wturm2016-08-25 17:08:23
MySQL
wturm, 2016-08-25 17:08:23

How to convert table from timestamp to datetime in phpmyadmin?

There is a database, it has a date field , in this field there are entries like: 1204298096, that is, in timestamp format, as far as I understand. There are more than 10 thousand such records.
It is necessary to convert these dates into datetime format like: 0000-00-00 00:00:00, this is ideal, but minutes and seconds can be trimmed if necessary, the main thing is year-month-day-hour ...
How to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wturm, 2016-08-25
@wturm

The problem was solved on another forum. Might be useful to someone:

ALTER TABLE rdle_post MODIFY date VARCHAR(19);
UPDATE rdle_post SET date=FROM_UNIXTIME(date);
ALTER TABLE rdle_post MODIFY date DATETIME;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question