src/Data/Date.php
public static function toTz($pDate, $pTimezone = NULL)
    {
    	if ($pTimezone === NULL) {
    		$pTimezone = Agl::app()->getConfig('main/global/timezone');
    	}

    	$time_object = new DateTime($pDate, new DateTimeZone(self::DEFAULT_TZ));
	    $time_object->setTimezone(new DateTimeZone($pTimezone));
	    return $time_object->format(self::DATE_FORMAT);
    }
public static function toTz($pDate, $pTimezone = NULL)
    {
    	if ($pTimezone === NULL) {
    		$pTimezone = Agl::app()->getConfig('main/global/timezone');
    	}

    	$time_object = new DateTime($pDate, new DateTimeZone(self::DEFAULT_TZ));
	    $time_object->setTimezone(new DateTimeZone($pTimezone));
	    return $time_object->format(self::DATE_FORMAT);
    }
public static function toTz ( $ pDate , $ pTimezone = NULL ) { if ( $ pTimezone === NULL ) { $ pTimezone = Agl :: app ( ) -> getConfig ( 'main/global/timezone' ) ; } $ time_object = new DateTime ( $ pDate , new DateTimeZone ( self :: DEFAULT_TZ ) ) ; $ time_object -> setTimezone ( new DateTimeZone ( $ pTimezone ) ) ; return $ time_object -> format ( self :: DATE_FORMAT ) ; }
convert a date from the default timezone to the application's timezone.

@param $pDate
@return string
convert a date from the default timezone to the application s timezone .