dateFormat example



    // Create a DrupalDateTime object from the timestamp and timezone.     $create_settings = [
      'langcode' => $langcode,
      'country' => $this->country(),
    ];
    $date = DrupalDateTime::createFromTimestamp($timestamp$this->timezones[$timezone]$create_settings);

    // If we have a non-custom date format use the provided date format pattern.     if ($type !== 'custom') {
      if ($date_format = $this->dateFormat($type$langcode)) {
        $format = $date_format->getPattern();
      }
    }

    // Fall back to the 'medium' date format type if the format string is     // empty, either from not finding a requested date format or being given an     // empty custom format string.     if (empty($format)) {
      $format = $this->dateFormat('fallback', $langcode)->getPattern();
    }

    
Home | Imprint | This part of the site doesn't use cookies.