I want to convert a Java timestamp into a php timestamp. I have a java code that creates a JSON Object and send the content of this object to a php-page, which should store them into a database.
My problem is, that the timestamps are different.
Java:
Wed Dec 14 14:06:07 CET 2016
The output (as long converted):
1481720767015
On php I tried two different solutions:
PHP:
echo date('d.m.Y H:i:s', intval("1481720767015")/1000);
echo "<br>".gmdate('d.m.Y H:i:s', intval("1481720767015")/1000);
The output:
14.12.2016 08:06:07
14.12.2016 13:06:07
So how can I change the timezone to get the second output to the right time/timezone?