Welcome to PHP Smarty Q&A, where you can ask programmaing questions and receive answers from other members of the community for PHP, Smarty, MYSQL related. You can also share or save your scripts in this repository for future reference.

Convert Timestamp which is in Long Number to readable date in PHP

+1 vote

One of my vendor has given me a timestamp as long number, i.e. 1472902325000

How do I convert this to readable date format as dd-mm-yyyy 00:00:00

Please help.

asked Sep 4, 2016 in PHP by anonymous

1 Answer

0 votes
Best answer

Assuming your timestamp with microtime, here it goes

echo date("d-m-Y H:i:s", 1472902325000/1000);

will return

03-09-2016 13:32:05

Hope thats what you are looking for.

answered Sep 4, 2016 by robert (13,210 points)
very veru thankful.