code: public static function formatDate($value, $format)
      {
          if ($value === null) {
              return false;
          }
  
          //Make sure we have timestamp
          if (!\is_int($value)) {
              $value = strtotime($value);
          }
          switch ($format) {
              case self::DATE_LONG:
                  $inflection = new Inflection();
                  $date = date('j', $value) . '. ' . $inflection->inflect(self::getMonthName(date('n', $value)))[2] . ' ' . date('Y', $value);
                  break;
              case self::DATE_SHORT:
                  $date = date('j. n. Y', $value);
                  break;
              case self::DATETIME_LONG:
                  $inflection = new Inflection();
                  $date =
                      date('j', $value) . '. ' . $inflection->inflect(self::getMonthName(date('n', $value)))[2] . ' ' .
                      date('Y G:i:s', $value);
                  break;
              case self::DATETIME_SHORT:
                  $date = date('j. n. Y G:i:s', $value);
                  break;
              default:
                  return false;
          }
  
          return $date;
      }
docs: Format date/datetime
  
  @param string|integer $value Timestamp or date accepted by strtotime()
  @param integer $format Date format
  
  @return bool|string Formatted date
  @static