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!
PHP timestamps are seconds, not milliseconds.
echo gmdate("d M Y H:i:s",1335997853);
That outputs 02 May 2012 22:30:53
.
it is not a java timestamp, it is milliseconds since epoch (1970-01-01 00:00:00 GMT)
Which php supports too except in seconds so the following should work in php:
date('choose your format', javaMilliseconds / 1000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With