fuso horário – de Javascript para PHP

/*Javascript*/
var d=new Date();
var offset = d.getTimezoneOffset()*60;
var timestamp = Math.ceil(d / 1000); //give this to PHP
console
.log('offset:'+offset);
console
.log('timestamp:'+timestamp);
console
.log(d.show());
/*PHP*/
$offsetServer
= date_offset_get(new DateTime); //in hour
echo
"Offset server : "; echo $offsetServer; echo "n";

$today
= new DateTime("now");
echo
"Current date server : "; echo date('Y/m/d H:i:s', $today->getTimestamp()); echo "n";

$ts
=1392381052; //in minute - get by javascript
$offsetClient
=18000; //in seconde - get by javascript
$offset
=$offsetClient+$offsetServer; //in second

$modifiedServer
=$today;
$modifiedServer
=$modifiedServer->setTimestamp($ts);
echo
"Modified date server : "; echo date('Y/m/d H:i:s', $modifiedServer->getTimestamp()); echo "n";
$modifiedClient
=$today;
$modifiedClient
->setTimestamp($ts-$offset);
echo
"Modified date client : "; echo date('Y/m/d H:i:s', $modifiedClient->getTimestamp()); echo "n";