View/Helper/TableHelper.php
protected function _replaceTime($str) {
		if (!preg_match_all('/\[time(.*?)\](.*)\[\/time\]/i', $str, $matches)) {
			// Fallback regex for when no options are passed.
			if (!preg_match_all('/\[time(.*?)\](.[^\[]*)\[\/time\]/i', $str, $matches)) {
				return $str;
			}
		}

		foreach ($matches[0] as $i => $find) {
			$opts = $this->_extractAttributes(trim($matches[1][$i]));

			foreach (Hash::normalize(array('method' => 'nice', 'format', 'timezone')) as $k => $v) {
				${$k} = $v;
				if (isset($opts[$k])) {
					${$k} = $opts[$k];
					unset($opts[$k]);
				}
			}

			App::uses('CakeTime', 'Utility');

			$replace = (empty($matches[2][$i])) ? '' : CakeTime::$method($matches[2][$i], $timezone, $format);
			$str = str_replace($find, $replace, $str);
		}

		return $str;
	}
protected function _replaceTime($str) {
		if (!preg_match_all('/\[time(.*?)\](.*)\[\/time\]/i', $str, $matches)) {
			// Fallback regex for when no options are passed.
			if (!preg_match_all('/\[time(.*?)\](.[^\[]*)\[\/time\]/i', $str, $matches)) {
				return $str;
			}
		}

		foreach ($matches[0] as $i => $find) {
			$opts = $this->_extractAttributes(trim($matches[1][$i]));

			foreach (Hash::normalize(array('method' => 'nice', 'format', 'timezone')) as $k => $v) {
				${$k} = $v;
				if (isset($opts[$k])) {
					${$k} = $opts[$k];
					unset($opts[$k]);
				}
			}

			App::uses('CakeTime', 'Utility');

			$replace = (empty($matches[2][$i])) ? '' : CakeTime::$method($matches[2][$i], $timezone, $format);
			$str = str_replace($find, $replace, $str);
		}

		return $str;
	}
protected function _replaceTime ( $ str ) { if ( ! preg_match_all ( '/\[time(.*?)\](.*)\[\/time\]/i' , $ str , $ matches ) ) { // Fallback regex for when no options are passed. if ( ! preg_match_all ( '/\[time(.*?)\](.[^\[]*)\[\/time\]/i' , $ str , $ matches ) ) { return $ str ; } } foreach ( $ matches [ 0 ] as $ i => $ find ) { $ opts = $ this -> _extractAttributes ( trim ( $ matches [ 1 ] [ $ i ] ) ) ; foreach ( Hash :: normalize ( array ( 'method' => 'nice' , 'format' , 'timezone' ) ) as $ k => $ v ) { $ { $ k } = $ v ; if ( isset ( $ opts [ $ k ] ) ) { $ { $ k } = $ opts [ $ k ] ; unset ( $ opts [ $ k ] ) ; } } App :: uses ( 'CakeTime' , 'Utility' ) ; $ replace = ( empty ( $ matches [ 2 ] [ $ i ] ) ) ? '' : CakeTime :: $ method ( $ matches [ 2 ] [ $ i ] , $ timezone , $ format ) ; $ str = str_replace ( $ find , $ replace , $ str ) ; } return $ str ; }
Replace by formatted time string.

Examples:
- [time]...[/time]
- [time format="m-d-Y"]...[/time]
- [time method="niceShort"]..[/time]

@param string $str String to check and modify.
@return string Modified string.
Replace by formatted time string .