Take the 2-minute tour ×

From an external website I receive, amongst other data, a date/time stamp like this 1346729259806 or 1346734102948 I have been trying to see what the best way to convert this into a formatted date/time readable for later use.

I found out that the timestamp is Epoch format in miliseconds. Is there a regular way to convert this?

Many thanks in advance

share|improve this question
possible duplicate of Converting a UNIX Timestamp to Formatted Date String –  therefromhere Sep 4 '12 at 3:34
add comment

2 Answers

date() function takes the second parameter as the timestamp.

echo date('Y-m-d H:i:s', 1346729259806/1000);
share|improve this answer
I have been seeking way to complex so it seems many thanks ! –  user1644984 Sep 4 '12 at 3:37
add comment

You can convert the timestamp to date in mysql by using DATE and FROM_UNIXTIME function. The command given bellow,

SELECT create FROM phpkit ;

The output created:



SELECT DATE( FROM_UNIXTIME( `created` ) ) AS pDate FROM phpkit



I found the source from the following link.

share|improve this answer
add comment

Your Answer


