How to convert java timestamp to php timestamp?

java, php, timestamp

Solution

PHP timestamps are seconds, not milliseconds.

echo gmdate("d M Y H:i:s",1335997853);

That outputs `02 May 2012 22:30:53`.

Problem

how can I convert a Java timestamp like this one `1335997853142` to a format that php can read? `1335997853142` should be `02 May 2012 22:30:53`. But what ever I try I get errors or PHP says `1970-01-01 01:00:00` or `2038-01-19 04:14:07` PLS help!!! I'm searching for over 1.5h for a soloution!

Original source