src/Core/DateTime/DateTimeTrait.php
public static function convert($date, $from = 'UTC', $to = 'UTC', $format = null)
    {
        $format = $format ?: self::$format;

        $from = new \DateTimeZone($from);
        $to   = new \DateTimeZone($to);
        $date = new static($date, $from);

        $date = $date->setTimezone($to);

        return $date->format($format, true);
    }
public static function convert($date, $from = 'UTC', $to = 'UTC', $format = null)
    {
        $format = $format ?: self::$format;

        $from = new \DateTimeZone($from);
        $to   = new \DateTimeZone($to);
        $date = new static($date, $from);

        $date = $date->setTimezone($to);

        return $date->format($format, true);
    }
public static function convert ( $ date , $ from = 'UTC' , $ to = 'UTC' , $ format = null ) { $ format = $ format ? : self :: $ format ; $ from = new \ DateTimeZone ( $ from ) ; $ to = new \ DateTimeZone ( $ to ) ; $ date = new static ( $ date , $ from ) ; $ date = $ date -> setTimezone ( $ to ) ; return $ date -> format ( $ format , true ) ; }
Convert a date string to another timezone.

@param string $date
@param string $from
@param string $to
@param string $format

@return  string
@throws \Exception
Convert a date string to another timezone .