For example i have a time string of "11:00" and and gmt offset string of "+02:00".
How can i combine the two to make the conversion in PHP?
Here is my current code:
$time = $row->time;
//Get users gmt setting
$timezone = $this->_get_gmt();
//calculate correct time here
$time = ; //whatever i have to do.
All answers appreciated.
$date = DateTime::createFromFormat('H:i P', '11:00 +02:00');
$date->setTimeZone(new DateTimeZone('GMT'));
echo $date->format('H:i');
This: