Prado\I18N\core\CultureInfo::getDateTimeFormat PHP Method

getDateTimeFormat() public method

Gets the DateTimeFormatInfo that defines the culturally appropriate format of displaying dates and times.
public getDateTimeFormat ( ) : DateTimeFormatInfo
return DateTimeFormatInfo date time format information for the culture.
    function getDateTimeFormat()
    {
        if ($this->dateTimeFormat === null) {
            $calendar = $this->getCalendar();
            $info = $this->findInfo("calendar/{$calendar}", true);
            $this->setDateTimeFormat(new DateTimeFormatInfo($info));
        }
        return $this->dateTimeFormat;
    }

Usage Example

Example #1
0
 /**
  * @return DateTimeFormatInfo date time format information for the current culture.
  */
 protected function getLocalizedCalendarInfo()
 {
     //expensive operations
     $culture = $this->getCurrentCulture();
     $info = new CultureInfo($culture);
     return $info->getDateTimeFormat();
 }