src/Alg/Time/DurationPhraseRanges.php
protected function calculateSeconds( $matches )
	{
		$value	= $matches[1];
		$format	= $matches[2];
		switch( $format )
		{
			case 's': 	return $value;
			case 'm': 	return $value * 60;
			case 'h': 	return $value * 60 * 60;
			case 'D': 	return $value * 60 * 60 * 24;
			case 'W': 	return $value * 60 * 60 * 24 * 7;
			case 'M': 	return $value * 60 * 60 * 24 * 30.4375;
			case 'Y': 	return $value * 60 * 60 * 24 * 365.25;
		}
		throw new Exception( 'Unknown date format "'.$format.'"' );
	}
protected function calculateSeconds( $matches )
	{
		$value	= $matches[1];
		$format	= $matches[2];
		switch( $format )
		{
			case 's': 	return $value;
			case 'm': 	return $value * 60;
			case 'h': 	return $value * 60 * 60;
			case 'D': 	return $value * 60 * 60 * 24;
			case 'W': 	return $value * 60 * 60 * 24 * 7;
			case 'M': 	return $value * 60 * 60 * 24 * 30.4375;
			case 'Y': 	return $value * 60 * 60 * 24 * 365.25;
		}
		throw new Exception( 'Unknown date format "'.$format.'"' );
	}
protected function calculateSeconds ( $ matches ) { $ value = $ matches [ 1 ] ; $ format = $ matches [ 2 ] ; switch ( $ format ) { case 's' : return $ value ; case 'm' : return $ value * 60 ; case 'h' : return $ value * 60 * 60 ; case 'D' : return $ value * 60 * 60 * 24 ; case 'W' : return $ value * 60 * 60 * 24 * 7 ; case 'M' : return $ value * 60 * 60 * 24 * 30.4375 ; case 'Y' : return $ value * 60 * 60 * 24 * 365.25 ; } throw new Exception ( 'Unknown date format "' . $ format . '"' ) ; }
Callback to replace Time Units by factorized Value.
@access		protected
@param		array		$matches		Array of Matches of regular Expression in 'addRange'.
@return		mixed
Callback to replace Time Units by factorized Value .