How often has this happened to you? You’re digging through the refrigerator looking for something to eat when suddenly you notice the “sell-by” date on the package. It’s several days past, so you toss the food out.

Americans throw away an estimated $165 billion in food every year, a good portion of it prompted by situations just like this. But in fact, most of those dates are largely meaningless.

In the first place, there’s a confusion of labels — “sell-by,” “best-by” and “use-by” are often read interchangeably by consumers, but they all mean different things.

The “sell-by” date is when the maker advises the store to pull the product from its shelves. The “best-by” date is when the maker believes the product will reach the end of its peak quality. It doesn’t mean the food isn’t safe after that.

The “use-by” date is the last date the manufacturer says the product should be used. However, this also is based on flavor and quality and it doesn’t mean the product is unsafe after that.

And, in fact, though they might look official, almost all of those dates are merely suggestions by the manufacturer. There are no federal guidelines that dictate what those terms mean or what the suggested storage times are for different foods.

Some states have rules covering some products but beyond that, you’re on your own.

According to the Department of Agriculture, package dates are used “to help the store determine how long to display the product for sale. It can also help the purchaser to know the time limit to purchase or use the product at its best quality. It is not a safety date.”

Confused? You’re in good company. A 2013 report by the Natural Resources Defense Council and Harvard Law School’s Food Law and Policy Clinic found that 90 percent of Americans were too.

Many foods can be safely — and even pleasurably — consumed well past their designated dates, provided adequate care is taken during storage.

A website called EatByDate is a good source for more detailed advice. Milk, for example, will last in the refrigerator five to seven days beyond its typical expiration date.

Eggs are usually good for an additional three to four weeks. Dried pasta will last for a couple of years beyond its usual date and canned tuna will be good for as many as five years.

Any food, of course, should be discarded if it smells or tastes off, if it is discolored or there are signs of mold or spoilage.

If you want to get really organized, there is, of course, an app for that. It’s called EatBy and so far it’s only available on Android.

EatBy allows you to catalog all the foods in your refrigerator and pantry, specifying by what date they should be used. You can use either the manufacturer’s suggested dates, or you can enter dates of your own. It’ll alert you when the item is nearing its designated time.

An iOS app is in the works — but so far there’s still no sign of a “sniff” feature that will let you know when that carton of milk has, definitively, gone off.