The time field in a table in the database is in the form of a timestamp. I want to convert the timestamp into the format of 2016-07-10 09:15:42. Can I change it? How to change it?
The time field in a table in the database is in the form of a timestamp. I want to convert the timestamp into the format of 2016-07-10 09:15:42. Can I change it? How to change it?
update table set on_time = FROM_UNIXTIME(on_time,'%Y-%m-%d %H:%i:%s')
<code>date('Y-m-d H:i:s', 1156219870);</code>
The timestamp is stored in int(11)?
It seems that it cannot be changed. First create a field to store the time format data to be transferred
update table set formate_time = FROM_UNIXTIME(on_time,'%Y-%m-%d %H:%i:%s') This SQL verification is feasible.