I send UNIX timestamp from javascript vat stamp = +new Date/1000
to PHP.
Then I do
//Here $d = '2015/04/03 00:00:00'
$d = new DateTime("@{$stamp}");
$d->setTimezone( new DateTimeZone( 'Pacific/Auckland' ) );
//Here $d = '2015/04/03 00:00:00' + 7:15 hrs ( 7:15 hrs is time diff between my browser & Auckland)
I want to change the timezone but keep the date to same. So, after I setTimezone
to Pacific/Auckland
, the date should still be '2015/04/03 00:00:00'
.