Most of the food you buy comes with a little “sell by” or “best by” date stamped on it. But these dates are—essentially—made up. Nobody regulates how long milk or cheese or bread stays good, so companies can essentially print whatever date they want on their products.

In the past few years, a bunch of food writers have explained to grocery shoppers that they should probably ignore those little numbers and just check to see if the food looks or smells bad. But, if sell-by dates are so useless, why do we even have them?

In Europe, sell-by dates are mandatory by law. But, according to Mic Wright at the Guardian:

The humble sell-by date actually has a surprisingly short history. It was introduced in Marks & Spencer's storerooms in the 1950s before making its way on to the shelves in 1970. It wasn't even actually called a "sell-by-date" until 1973. Marks is so proud of its innovation that Twiggy trumpets it in their latest ad campaign.

In the United States, federal law requires only that infant formula be dated, but many states have similar regulations for products like milk, eggs and meat. But most food manufacturers date pretty much everything anyway.

There's a fun bit of speculation, which one reporter attributed to a park ranger at Alcatraz, that Al Capone popularized expiration dates on milk back in the 1930s. The story goes that one of Capone’s family members got sick after drinking some expired milk, and Capone got interested in the milk industry. He bought up a milk processor, called Meadowmoor Dairies, and he lobbied the Chicago City Council to pass a law requiring visible date stamps on milk containers. But food labeling on all kinds of food doesn’t really happen until the 1970s, according to a recent Natural Resources Defense Council report.

The NRDC report details how consumers in the 1960s started to buy more processed foods, and as they got further away from the direct production of the ingredients in their meals, they got more worried about just how safe and fresh those ingredients were:

Open dating uses a date label that includes a month, day, and year in a format clearly evident to the consumer. Out of a nationwide survey of 250,000 shoppers published in 1975, 89 percent of respondents favored this kind of dating system. According to another survey, 95 percent of respondents listed open dating as the “most useful” consumer service for addressing product freshness concerns. “Open” dating differed from the long-established industry practice of “closed” dating, in which manufacturers and retailers used symbols or numerical codes that were undecipherable to consumers to manage their inventory and stock rotation, without any intention of relaying that information directly to consumers. Throughout the 1970s, many supermarkets voluntarily adopted open dating systems in response to mounting consumer interest.

In response, states started mandating labeling laws, many of which we still live with today. Some have tried to get rid of the unscientific labels, but when the U.K. suggested changing the sell by labels, manufacturers weren’t pleased. There's also speculation out there that manufacturers want you to use the dates because it means you wind up throwing out and buying more of their product. But it’s probably safe to say that you can ignore whatever date's printed on your food and go for a simple sniff test.