MySQL selects timestamp as date string

I have a table with a create_time column that is of type INTEGER and represents time from an era.

I would like to select all rows and columns, showing this row as a date / time in UTC.

How to do it?

+7
sql mysql timestamp
source share
1 answer

Use FROM_UNIXTIME to convert seconds from an era to DATETIME, which also allows you to specify the format:

 FROM_UNIXTIME(create_time, '%Y-%m-%d %H:%i:%s') 
+8
source share

All Articles