需要将sql中的字符串(时间)转换为php中的实际日期[复制]

I have a table with a time (int 4) where is stored time ex:1506201203

That would be:

year-mo-da-hh-mm
2015-06-20-12-03

I need a php script to get the time and display it correctly ..

A bit of help ?

</div>

You can use from_unixtime.

FROM_UNIXTIME(column_name, '%Y-%m-%d') in your MySQL query.

Or you can just use date function.

date('Y-m-d-h-m', $n['date']).