The date is always from the year 2000 since RFC does not provide century and 000229 is valid.
Please, change this function on year 2100!

@param string $rfc
@return int
512132
public static function obtainDate(string $rfc): int
    {
        // rfc is multibyte
        $begin = (mb_strlen($rfc) === 12) ? 3 : 4;
        // strdate is not multibyte
        $strdate = strval(mb_substr($rfc, $begin, 6));
        $parts = str_split($strdate, 2);
        // year 2000 is leap year (%4 & %100 & %400)
        /** @var int|false $date phpstan does not know that mktime can return false */
        $date = mktime(0, 0, 0, (int) $parts[1], (int) $parts[2], (int) ('20' . $parts[0]));
        if (false === $date) {
            return 0;
        }
        if (date('ymd', $date) !== $strdate) {
            return 0;
        }
        return $date;
    }
11000
public function year($value = null)
    {
        if ($value !== null) {
            if ($value < 0 || $value > 9999) {
                $this->year = 0;
            } else {
                $this->year = $value;
            }
        }
        return $this->year;
    }
1241625
private function getDosTime($timestamp = 0) {
        $timestamp = (int)$timestamp;
        $oldTZ = @date_default_timezone_get();
        date_default_timezone_set('UTC');
        $date = ($timestamp == 0 ? getdate() : getdate($timestamp));
        date_default_timezone_set($oldTZ);
        if ($date["year"] >= 1980) {
            return pack("V", (($date["mday"] + ($date["mon"] << 5) + (($date["year"]-1980) << 9)) << 16) |
                             (($date["seconds"] >> 1) + ($date["minutes"] << 5) + ($date["hours"] << 11)));
        }
        return "\x00\x00\x00\x00";
    }
418369
private function getExpiresTime($time): int
    {
        if ($time instanceof \DateTimeInterface) {
            return (int) $time->format('U');
        }

        if (\is_numeric($time)) {
            // average year in seconds
            if ($time <= 31557600) {
                $time += \time();
            }

            return (int) $time;
        }

        return (int) (new \DateTime($time))->format('U');
    }
1203060
public function isYearInDateFormat(string $dateFormat)
    {
        return false !== strpos($dateFormat, 'o') ||
            false !== strpos($dateFormat, 'Y') ||
            false !== strpos($dateFormat, 'y');
    }
517934
public static function calculateYearsAgo(DateDiffRequest $request)
    {
        return new DateDiffResult($request, self::YEARS_AGO, $request->getInterval()->y);
    }
135887
public static function validateCloseCode($code)
    {
        return !($code < 1000 || //Not used
            $code > 5000 || //Invalid
            ($code > 1015 && $code < 3000) || //Range 1000-2999 is reserved for protocol, but currently there are no codes above 1015
            $code === 1004 || //Reserved
            $code === self::CODE_NO_STATUS || //Reserved (internal app usage)
            $code === self::CODE_ABNORMAL || //Reserved (internal app usage)
            ($code > 1011 && $code <= 1015) //Not defined by RFC, but from reserved range (exc. 1015 is reserved for app int. use)
        );
    }
976473
public function Rfc2822()
    {
        $formatter = $this->getInternalFormatter();
        $formatter->setPattern('y-MM-dd HH:mm:ss');
        return $formatter->format($this->getTimestamp());
    }
747451
public static function GetCurrentDate( $context )
	{
		$res = DateValue::fromDate( false, new \DateTime( "@" . $context->RunningContext->now ) );
		$res->IsLocal = false;
		$res->Value->microseconds = 0;
		return $res;
	}
328242
private static function _marshalProtocolVersion($server)
    {
        if (!isset($server['SERVER_PROTOCOL'])) {
            return '1.1';
        }

        if (!preg_match(
            '#^(HTTP/)?(?P<version>[1-9]\d*(?:\.\d)?)$#',
            $server['SERVER_PROTOCOL'], $matches
        )
        ) {
            throw new UnexpectedValueException(
                sprintf(
                    'Unrecognized protocol version (%s)',
                    $server['SERVER_PROTOCOL']
                )
            );
        }

        return $matches['version'];
    }
85403
static function UnixDate($v)
	{
	global $ADODB_sybase_mths;

		//Dec 30 2000 12:00AM
		if (!preg_match( "/([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})/"
			,$v, $rr)) return parent::UnixDate($v);

		if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;

		$themth = substr(strtoupper($rr[1]),0,3);
		$themth = $ADODB_sybase_mths[$themth];
		if ($themth <= 0) return false;
		// h-m-s-MM-DD-YY
		return  adodb_mktime(0,0,0,$themth,$rr[2],$rr[3]);
	}
334369
public static function getCurrentYear($inUTC = false, $format = self::YEAR_FORMAT_LONG)
    {
        $tz = $inUTC ? 'UTC' : null;

        return (int) static::now($tz)->format($format);
    }
351327
public function isLeapYear(int $year = null) : bool
    {
        return !!date(
            'L',
            $year === null ? $this->getTimestamp() : mktime(1, 1, 1, 2, 1, $year)
        );
    }
909677
public static function valid($str)
    {
        if (!is_numeric($str) && !is_string($str)) {
            return false;
        }

        $str = strval($str);

        $parts = array_pad(self::getParts($str), 7, '');

        if (in_array('', $parts, true)) {
            return false;
        }

        list($century, $year, $month, $day, $sep, $num, $check) = array_values($parts);

        $validDate = checkdate($month, $day, strval($century) . strval($year));
        $validCoOrdinationNumber = checkdate($month, intval($day) - 60, strval($century) . strval($year));

        if (!$validDate && !$validCoOrdinationNumber) {
            return false;
        }

        $valid = self::luhn($year . $month . $day . $num) === intval($check);

        return $valid;
    }
1315534
public static function getDaysInYear($year = null): int
    {
        $year = $year ? $year : date('Y');
        return self::isLeapYear($year) ? 366 : 365;
    }
1207350
private function getNonce($length = 20)
    {
        $parts = explode('.', number_format(microtime(true), 22, '.', ''));
        if (! isset($parts[1])) {
            $parts[1] = 0;
        }
        $nonce = base_convert($parts[1], 10, 36);

        for ($i = 0; $i < $length - strlen($nonce); $i++) {
            $nonce .= base_convert(mt_rand(0, 35), 10, 36);
        }

        return $nonce;
    }
632765
def _parse_date_rfc822(dateString):
    ''''''
    data = dateString.split()
    if data[0][-1] in (',', '.') or data[0].lower() in _daynames:
        del data[0]
    if len(data) == 4:
        s = data[3]
        s = s.split('+', 1)
        if len(s) == 2:
            data[3:] = s
        else:
            data.append('')
        dateString = " ".join(data)
    if len(data) < 5:
        dateString += ' 00:00:00 GMT'
    return email.utils.parsedate_tz(dateString)