PHP : convert date to another time zone

function converToTz($time=””,$toTz=”,$fromTz=”)
{
// timezone by php friendly values
$date = new DateTime($time, new DateTimeZone($fromTz));
$date->setTimezone(new DateTimeZone($toTz));
$time= $date->format(‘Y-m-d H:i:s’);
return $time;
}
echo date_default_timezone_get();
echo converToTz(‘2019-08-07 13:00:00’, ‘UTC’, ‘Asia/Calcutta’);