public function getUserValue($val)
    {
        if ('' == $val) {
            return '';
        }

        if ($val instanceof PhpDateTime) {
            $date = $val;
            $date->setTimezone(new DateTimeZone($this->getSourceTimezone()));
            $date->setTimezone(new DateTimeZone($this->getOutputTimezone()));
        } else {
            $date = PhpDateTime::createFromFormat(
                $this->getSourceDateTimeFormat(),
                $val,
                new DateTimeZone($this->getSourceTimezone())
            );
            if (false === $date) {
                return '';
            }
            $date->setTimezone(new DateTimeZone($this->getOutputTimezone()));
        }
        $formatter = new IntlDateFormatter(
            $this->getLocale(),
            $this->getOutputDateType(),
            $this->getOutputTimeType(),
            $this->getOutputTimezone(),
            IntlDateFormatter::GREGORIAN,
            $this->getOutputPattern()
        );

        return $formatter->format($date->getTimestamp());
    }
public function getUserValue($val)
    {
        if ('' == $val) {
            return '';
        }

        if ($val instanceof PhpDateTime) {
            $date = $val;
            $date->setTimezone(new DateTimeZone($this->getSourceTimezone()));
            $date->setTimezone(new DateTimeZone($this->getOutputTimezone()));
        } else {
            $date = PhpDateTime::createFromFormat(
                $this->getSourceDateTimeFormat(),
                $val,
                new DateTimeZone($this->getSourceTimezone())
            );
            if (false === $date) {
                return '';
            }
            $date->setTimezone(new DateTimeZone($this->getOutputTimezone()));
        }
        $formatter = new IntlDateFormatter(
            $this->getLocale(),
            $this->getOutputDateType(),
            $this->getOutputTimeType(),
            $this->getOutputTimezone(),
            IntlDateFormatter::GREGORIAN,
            $this->getOutputPattern()
        );

        return $formatter->format($date->getTimestamp());
    }
public function getUserValue ( $ val ) { if ( '' == $ val ) { return '' ; } if ( $ val instanceof PhpDateTime ) { $ date = $ val ; $ date -> setTimezone ( new DateTimeZone ( $ this -> getSourceTimezone ( ) ) ) ; $ date -> setTimezone ( new DateTimeZone ( $ this -> getOutputTimezone ( ) ) ) ; } else { $ date = PhpDateTime :: createFromFormat ( $ this -> getSourceDateTimeFormat ( ) , $ val , new DateTimeZone ( $ this -> getSourceTimezone ( ) ) ) ; if ( false === $ date ) { return '' ; } $ date -> setTimezone ( new DateTimeZone ( $ this -> getOutputTimezone ( ) ) ) ; } $ formatter = new IntlDateFormatter ( $ this -> getLocale ( ) , $ this -> getOutputDateType ( ) , $ this -> getOutputTimeType ( ) , $ this -> getOutputTimezone ( ) , IntlDateFormatter :: GREGORIAN , $ this -> getOutputPattern ( ) ) ; return $ formatter -> format ( $ date -> getTimestamp ( ) ) ; }
Convert the value from the source to the value, which the user will see in the column.

@param mixed $val

@return string
Convert the value from the source to the value which the user will see in the column .