How can I convert a Unix timestamp back to time?

esafwan picture esafwan · Apr 5, 2011 · Viewed 43.7k times · Source

I have the following Unix timestamps.

1301982430 1301982430 1301981474

1301981466 1301981466 1301981066

1301981058 1301981058 1301980388

1301980373 1301980373 1301979082

1301978478 1301978478 1301978478

How do I convert it back to time that's human friendly?

This doesn't seem to work,

strtotime($item->timestamp);

Answer

Shakti Singh picture Shakti Singh · Apr 5, 2011

You can use the php date function to get the date and time.

echo date('Y-m-d h:i:s',$item->timestamp);