Contao\Date::getNumericDateFormat PHP Method

getNumericDateFormat() public static method

Return the numeric date format string
public static getNumericDateFormat ( ) : string
return string The numeric date format string
    public static function getNumericDateFormat()
    {
        if (TL_MODE == 'FE') {
            /** @var PageModel $objPage */
            global $objPage;
            if ($objPage->dateFormat != '' && static::isNumericFormat($objPage->dateFormat)) {
                return $objPage->dateFormat;
            }
        }
        return \Config::get('dateFormat');
    }

Usage Example

 public static function getSeparatedNumericDateTimeInterval($intStartDate = null, $intEndDate = null, $intStartTime = null, $intEndTime = null, $strIntervalDelimiter = ' – ', $strDelimiter = ', ')
 {
     $strStartDate = \Contao\Date::parse(\Contao\Date::getNumericDateFormat(), $intStartDate);
     $strEndDate = \Contao\Date::parse(\Contao\Date::getNumericDateFormat(), $intEndDate);
     $strStartTime = \Contao\Date::parse(\Contao\Date::getNumericTimeFormat(), $intStartTime);
     $strEndTime = \Contao\Date::parse(\Contao\Date::getNumericTimeFormat(), $intEndTime);
     $strResult = $strStartDate;
     if ($intEndDate > 0 && $intEndDate > $intStartDate && $strStartDate != $strEndDate) {
         $strResult .= $strIntervalDelimiter . $strEndDate;
     }
     if ($intStartTime > 0) {
         if ($intEndTime > $intStartTime && $strStartTime != $strEndTime) {
             $strResult .= $strDelimiter . $strStartTime . $strIntervalDelimiter . $strEndTime;
         } else {
             $strResult .= $strDelimiter . $strStartTime;
         }
     }
     return $strResult;
 }
All Usage Examples Of Contao\Date::getNumericDateFormat