You would use a combination of DateTime()
, DateInterval()
, and DateTimeZone()
:
$flight = new DateTime('07:00', new DateTimeZone('America/New_York'));
$flight->add(new DateInterval('PT2H48M'));
$flight->setTimeZone(new DateTimeZone('America/Chicago'));
echo $flight->format('h:iA');
- Create a
DateTime()
object representing the departure time in New York's timezone - Add 2 hours and 48 minutes of flight time
- Change the timezone to Chicago's timezone
- Print out the arrival time