The U.S. stock market is hours from hitting a notable milestone, but it isn’t one that investors will feel particularly good about.

Both the Dow Jones Industrial Average DJIA, +0.55% and the S&P 500 SPX, +0.60% have been mired in correction territory for months, ever since Feb. 8, when concerns that inflation was returning to the economy sparked a selloff that led to their dropping 10% from record levels hit earlier in the year.

Amid months of rangebound trading, neither index has been able to fully recover or exit correction territory (the Nasdaq Composite Index COMP, +0.68% , which never officially corrected, is currently at record levels). For the S&P, exiting correction territory would require it to rise to 2,839.1, or a 10% gain from its low of the correction. It closed Friday at 2,801.31.

Don’t miss:Stop saying the Dow is moving in and out of correction! That is not how stock-market moves work

Including Friday, both the Dow and the S&P have been in correction territory for 108 trading days. This matches the longest such stretch since the financial crisis in 2008.

Should the two primary market gauges stay in correction through the close of trading on Monday, that will mean they are in their longest such stretch since 1984. In that stretch, it took the S&P 122 days to emerge from correction territory, and the Dow 123 days, according to the WSJ Market Data Group.

Corrections of this length are extremely unusual. According to the data, of the past 20 corrections (including the ongoing one), only two lasted longer than 100 trading sessions. The average correction length since the inception of the S&P 500 is 51 trading days. The longest stretch in correction territory ever was a period of 229 trading days that ended in 1978.

Based on their Friday closing levels, the Dow would need to rise about 6% to hit a new record while the S&P 500 would need to gain 2.5%.

Despite the bearish record that is likely to be set at the close of trading on Monday, the market is also nearing a more positive milestone. On a total-return basis, the S&P 500 is just days away from its longest stretch above its 200-day moving average in its history.

Read:The rally in stocks is days away from setting a notable record for longevity