framework/i18n/CDateFormatter.php
public function formatDateTime($timestamp,$dateWidth='medium',$timeWidth='medium')
	{
		if(!empty($dateWidth))
			$date=$this->format($this->_locale->getDateFormat($dateWidth),$timestamp);

		if(!empty($timeWidth))
			$time=$this->format($this->_locale->getTimeFormat($timeWidth),$timestamp);

		if(isset($date) && isset($time))
		{
			$dateTimePattern=$this->_locale->getDateTimeFormat();
			return strtr($dateTimePattern,array('{0}'=>$time,'{1}'=>$date));
		}
		elseif(isset($date))
			return $date;
		elseif(isset($time))
			return $time;
	}
public function formatDateTime($timestamp,$dateWidth='medium',$timeWidth='medium')
	{
		if(!empty($dateWidth))
			$date=$this->format($this->_locale->getDateFormat($dateWidth),$timestamp);

		if(!empty($timeWidth))
			$time=$this->format($this->_locale->getTimeFormat($timeWidth),$timestamp);

		if(isset($date) && isset($time))
		{
			$dateTimePattern=$this->_locale->getDateTimeFormat();
			return strtr($dateTimePattern,array('{0}'=>$time,'{1}'=>$date));
		}
		elseif(isset($date))
			return $date;
		elseif(isset($time))
			return $time;
	}
public function formatDateTime ( $ timestamp , $ dateWidth = 'medium' , $ timeWidth = 'medium' ) { if ( ! empty ( $ dateWidth ) ) $ date = $ this -> format ( $ this -> _locale -> getDateFormat ( $ dateWidth ) , $ timestamp ) ; if ( ! empty ( $ timeWidth ) ) $ time = $ this -> format ( $ this -> _locale -> getTimeFormat ( $ timeWidth ) , $ timestamp ) ; if ( isset ( $ date ) && isset ( $ time ) ) { $ dateTimePattern = $ this -> _locale -> getDateTimeFormat ( ) ; return strtr ( $ dateTimePattern , array ( '{0}' => $ time , '{1}' => $ date ) ) ; } elseif ( isset ( $ date ) ) return $ date ; elseif ( isset ( $ time ) ) return $ time ; }
Formats a date according to a predefined pattern.
The predefined pattern is determined based on the date pattern width and time pattern width.
@param mixed $timestamp UNIX timestamp or a string in strtotime format
@param string $dateWidth width of the date pattern. It can be 'full', 'long', 'medium' and 'short'.
If null, it means the date portion will NOT appear in the formatting result
@param string $timeWidth width of the time pattern. It can be 'full', 'long', 'medium' and 'short'.
If null, it means the time portion will NOT appear in the formatting result
@return string formatted date time.
Formats a date according to a predefined pattern . The predefined pattern is determined based on the date pattern width and time pattern width .