Convert date from one timezone to another timezone PHP
This example is from phone call history
//set default time zone
date_default_timezone_set('America/New_York');
//Set call date and time
$call_date = new DateTime(date("d-m-Y H:i:s", strtotime($call['calldate']." ".$call['calltime'])));
//Create new time zone object
$la_time = new DateTimeZone('Europe/London');
//Set time zone to date
$call_date->setTimezone($la_time);
echo $call_date->format('d-m-Y');
echo $call_date->format("H:i:s");
Chamath Gunasekara
Comments