Produce is pretty variable stuff. Some vegetables, including cabbages, winter squashes and root vegetables, can last for several months in a reasonably cool, dry spot. Other things, like fresh herbs, may only give you a day or two before you take their sad little remains to the compost. Mushrooms aren't quite that delicate, but they're definitely among the shorter-lived forms of produce.
No Firm Rules for Mushroom Expiry
When you buy mushrooms at the supermarket, they'll usually have a date on them if they're packaged but won't if they're sold loose in bulk. That date might be a packing date, to let you know when those mushrooms went into the package you see. It might be a "sell-by" date, which the store uses to tell its staff when to mark down or remove the mushrooms from the main produce display. It might also be a "use-by" or "best-before" date, intended to give you some guidance as to how long the mushrooms will stay at their best and freshest.
What all those dates have in common is what they aren't: an expiry date. You won't find a situation where mushrooms are safe to eat on one day and dangerous on the next. Like any other piece of produce, they'll begin to lose their quality and freshness long before there's a serious risk of them making you ill. The key is to use your common sense, or more accurately your physical senses, to decide when a mushroom is past its prime.
Clear, Visual Signs of Spoilage
Mushrooms come in different shapes, sizes and colors, but some signs of spoilage and deterioration are pretty universal. One is the presence of sunken, dark spots on the cap of the mushroom. If you turn the mushroom over and look at the gills on its underside, they should stand up neatly and look dry. If they're black and wet-looking, and if they've collapsed against the cap of the mushroom, the mushroom has begun to spoil.
Slime is also a clear warning sign of spoilage. Mushrooms are mostly made up of water, and they become slimy as their cell walls break down and release liquid. You may also notice a dark, inky liquid in the bottom of the package. If the mushroom is black inside, or if the stem is dark and shriveled, you should discard it.
Use Your Nose
You can also rely on your nose for some guidance. Fresh mushrooms have a pleasantly light and earthy fragrance. If they smell funky or "fishy," that's a bad sign. However, shimeji mushrooms can have a faint fishiness. Enoki and oyster mushrooms belong to the shimeji family, and should have a delicate "good fish" smell of fresh seafood, rather than the "bad fish" smell of a fish that's been sitting on a riverbank in the sun for a few days.
Some Basic Guidance
As a rule, your mushrooms will stay better for longer if you store them properly. Keeping them trapped in airtight plastic packaging is usually not a good idea even if that's how they came from the store. Mushrooms are living things, and if they're trapped in an airtight environment they won't be able to respire. The moisture that's trapped in the package creates an environment that speeds spoilage.
You're better off to either bring them home from the store in a paper bag, or transfer them to a paper bag as soon as you get home. A loosely closed bag lets some air in and out, which helps prevent moisture buildup and prolongs the life of the mushrooms. Whole mushrooms will usually keep for a week or so in the fridge, and perhaps a day or two longer if they were especially fresh to begin with.
Sliced mushrooms aren't nearly as long-lasting, because cut surfaces will begin to deteriorate more quickly than an intact mushroom. They're best used within the first day or two. Any mushrooms are best when they're at their absolute freshest, so try to cook them within the first 24 hours whenever possible.