-7

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 ?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • already has an answer here:http://stackoverflow.com/questions/10040291/converting-a-unix-timestamp-to-formatted-date-string – BigScar Jun 20 '15 at 11:35

1 Answers1

0

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']).
Hamza Zafeer
  • 2,360
  • 13
  • 30
  • 42
Louay Ali
  • 11
  • 4