I have seen many recommendations to buy a new helmet when the helmet is 5-7 years old.
I can not find any date stamp easy to find as on tires.
It is not nice if there are helmets on sale that are NOS helmets with several years on the shelf, close to by manufacturers recommended end of life.
If the age is more important than use it must be clear information on the helmet like tires DOT stamp.
My favourite helmet was ordered late 2014, arrived around Christmas. It's graphic was new 2014.
Fiberglass shell.
That helmet fits my head really well. The white EPS foam inside is not hard or falling into pieces, yet.
The inner lining feels a little aged and dry after 10 seasons. Or ca 55.000 km which might be a better value of use.
I think I will skip the replace helmet recommendation and buy new lining.
I have another helmet, same model, different color but not much used. Bought on sale from France 2020.
Who knows when that was produced?
It fits really tight and good.
The white EPS foam inside and inner lining feels fresh, like new as it is. Max 5 hours on head.
It had some too tight pain giving spots of the inner EPS foam I have adjusted with a small round shaped hammer.
Manufacturers description:
"The fibreglass fabric combined with a special resin is compressed in a vacuum at high pressure to form an exceptionally sturdy yet uniquely light helmet shell. "
I heard back in the early 80's that cheap polycarbonate helmets were not long lived. Attach stickers or paint on them a big no-no. They were told to act as a ball when hitting the road bouncing too much.
Fiberglass and in a mix with other fibers have been my choice.
So I'll go for a new inner lining on my 10 years old fiberglass helmet since the shock absorbing EPS foam feels OK. Not falling into pieces when poking it with a finger and nail.
The later helmets EPS feels similar.
The helmets end date should be clearly written on the outside if that is how it works.
It should be possible to test the EPS foam if still OK. Not hardened by age.
If falling into pieces is easy to test

Each riding season is max 6 months anyway.
So 10 years is max 5 years. So no problem with another 4 half years then?

I have had several very close moments the last years the helmet should not have helped me

I guess I'm not alone with these thoughts.
Buy a new $600-1000 US helmet every 5-7 years when it still feels and look fresh ...?