src/Carbon/Traits/Date.php
public function meridiem(bool $isLower = false): string
    {
        $hour = $this->hour;
        $index = $hour < 12 ? 0 : 1;

        if ($isLower) {
            $key = 'meridiem.'.($index + 2);
            $result = $this->translate($key);

            if ($result !== $key) {
                return $result;
            }
        }

        $key = "meridiem.$index";
        $result = $this->translate($key);
        if ($result === $key) {
            $result = $this->translate('meridiem', [
                ':hour' => $this->hour,
                ':minute' => $this->minute,
                ':isLower' => $isLower,
            ]);

            if ($result === 'meridiem') {
                return $isLower ? $this->latinMeridiem : $this->latinUpperMeridiem;
            }
        } elseif ($isLower) {
            $result = mb_strtolower($result);
        }

        return $result;
    }
public function meridiem(bool $isLower = false): string
    {
        $hour = $this->hour;
        $index = $hour < 12 ? 0 : 1;

        if ($isLower) {
            $key = 'meridiem.'.($index + 2);
            $result = $this->translate($key);

            if ($result !== $key) {
                return $result;
            }
        }

        $key = "meridiem.$index";
        $result = $this->translate($key);
        if ($result === $key) {
            $result = $this->translate('meridiem', [
                ':hour' => $this->hour,
                ':minute' => $this->minute,
                ':isLower' => $isLower,
            ]);

            if ($result === 'meridiem') {
                return $isLower ? $this->latinMeridiem : $this->latinUpperMeridiem;
            }
        } elseif ($isLower) {
            $result = mb_strtolower($result);
        }

        return $result;
    }
public function meridiem ( bool $ isLower = false ) : string { $ hour = $ this -> hour ; $ index = $ hour < 12 ? 0 : 1 ; if ( $ isLower ) { $ key = 'meridiem.' . ( $ index + 2 ) ; $ result = $ this -> translate ( $ key ) ; if ( $ result !== $ key ) { return $ result ; } } $ key = "meridiem.$index" ; $ result = $ this -> translate ( $ key ) ; if ( $ result === $ key ) { $ result = $ this -> translate ( 'meridiem' , [ ':hour' => $ this -> hour , ':minute' => $ this -> minute , ':isLower' => $ isLower , ] ) ; if ( $ result === 'meridiem' ) { return $ isLower ? $ this -> latinMeridiem : $ this -> latinUpperMeridiem ; } } elseif ( $ isLower ) { $ result = mb_strtolower ( $ result ) ; } return $ result ; }
Return the meridiem of the current time in the current locale.

@param bool $isLower if true, returns lowercase variant if available in the current locale.

@return string
Return the meridiem of the current time in the current locale .