core-bundle/src/Resources/contao/library/Contao/Date.php
public static function getInputFormat($strFormat=null)
	{
		if ($strFormat === null)
		{
			$strFormat = static::getNumericDateFormat();
		}

		if (!static::isNumericFormat($strFormat))
		{
			throw new \Exception(sprintf('Invalid date format "%s"', $strFormat));
		}

		$arrCharacterMapper = array();

		foreach ($GLOBALS['TL_LANG']['DATE'] as $k=>$v)
		{
			$arrCharacterMapper[$k] = $v;
		}

		$arrInputFormat = array();
		$arrCharacters = str_split($strFormat);

		foreach ($arrCharacters as $strCharacter)
		{
			if (isset($arrCharacterMapper[$strCharacter]))
			{
				$arrInputFormat[$strFormat] .= $arrCharacterMapper[$strCharacter];
			}
			else
			{
				$arrInputFormat[$strFormat] .= $strCharacter;
			}
		}

		return $arrInputFormat[$strFormat];
	}
public static function getInputFormat($strFormat=null)
	{
		if ($strFormat === null)
		{
			$strFormat = static::getNumericDateFormat();
		}

		if (!static::isNumericFormat($strFormat))
		{
			throw new \Exception(sprintf('Invalid date format "%s"', $strFormat));
		}

		$arrCharacterMapper = array();

		foreach ($GLOBALS['TL_LANG']['DATE'] as $k=>$v)
		{
			$arrCharacterMapper[$k] = $v;
		}

		$arrInputFormat = array();
		$arrCharacters = str_split($strFormat);

		foreach ($arrCharacters as $strCharacter)
		{
			if (isset($arrCharacterMapper[$strCharacter]))
			{
				$arrInputFormat[$strFormat] .= $arrCharacterMapper[$strCharacter];
			}
			else
			{
				$arrInputFormat[$strFormat] .= $strCharacter;
			}
		}

		return $arrInputFormat[$strFormat];
	}
public static function getInputFormat ( $ strFormat = null ) { if ( $ strFormat === null ) { $ strFormat = static :: getNumericDateFormat ( ) ; } if ( ! static :: isNumericFormat ( $ strFormat ) ) { throw new \ Exception ( sprintf ( 'Invalid date format "%s"' , $ strFormat ) ) ; } $ arrCharacterMapper = array ( ) ; foreach ( $ GLOBALS [ 'TL_LANG' ] [ 'DATE' ] as $ k => $ v ) { $ arrCharacterMapper [ $ k ] = $ v ; } $ arrInputFormat = array ( ) ; $ arrCharacters = str_split ( $ strFormat ) ; foreach ( $ arrCharacters as $ strCharacter ) { if ( isset ( $ arrCharacterMapper [ $ strCharacter ] ) ) { $ arrInputFormat [ $ strFormat ] .= $ arrCharacterMapper [ $ strCharacter ] ; } else { $ arrInputFormat [ $ strFormat ] .= $ strCharacter ; } } return $ arrInputFormat [ $ strFormat ] ; }
Return an input format string for a particular date (e.g. YYYY-MM-DD)

@param string $strFormat An optional format string

@return string The input format string

@throws \Exception If $strFormat is invalid
Return an input format string for a particular date ( e . g . YYYY - MM - DD )