If you have a lot of Halloween candy around the house this morning — and a lot of willpower — some of those sweets might still be around several months from now. A Virginia Tech food safety expert says there is no need to worry: most of it will still be good months and sometimes years from now, often well past any printed expiration dates. Dark chocolate can hold up one to two years, other chocolates 9 months to one year. Other treats are likely to remain their taste and texture for six to nine months. More from WFIR’s Evan Jones:

VIRGINIA TECH NEWS RELEASE: Is month-old Halloween candy safe to eat? If so, how much longer is that the case? Should you just throw the whole bag out? According to Virginia Tech consumer food safety expert Joell Eifert, the answer is bittersweet, but still likely longer than you think.

“Consumers often have the misconception that the best by date on food packaging equates to food safety,” Eifert said. “In the case of most commercially processed foods, it’s contamination during processing and packaging that leads to foodborne illness, not the age of the food. So, even after some time passes, candy should be safe to eat as long as it was properly handled and it remains unopened prior to eating.”

This notion is just one of many misbeliefs that people have about when to toss their leftover sweets, Eifert said. For example, consumers often throw out chocolate once it begins to develop a whitish coating on it, mistaking it for mold. This phenomenon — known as chocolate “bloom” — is completely safe.

“If chocolate is stored in warmer temperatures, the fat can begin to separate from the cocoa,” Eifert explained. “This separation is what causes the coating to form. However, bloom does not destroy the flavor of the chocolate, and it’s perfectly safe to eat.”

So, your candy will be safe to eat months after Halloween is in the rear view mirror. But that’s not to say that all of it will be just as fresh and appetizing a year from now. That depends on a number of factors, said Eifert.

“Candy can develop off-odors and changes in flavor, appearance and texture,” she said. “Although there may be no food safety issues with the candy, you may choose not to eat it for other quality reasons. Shelf life of candy is a function of storage conditions, packaging, and ingredients. Some can be good for several years, but some will last only a few months.”

Eifert offered a helpful guide based on information from the National Confectioner’s Association for deciding how long each item in your candy collection should stick around:

●       Chocolate – All chocolate is made of cocoa butter and/or cocoa powder, and the fats in chocolate normally oxidize over time when exposed to oxygen, causing it to become stale or causing off-odors and flavors. The higher the cocoa content the longer the product will last, so dark chocolate has a much longer quality shelf life than white chocolate. Dark chocolate can be kept for 1-2 years if wrapped in foil and stored in a cool, dark and dry place, such as a pantry or basement. Milk and white chocolate have a more limited storage time — no more than 8-10 months.

●       Hard candy – Hard candies can last up to a year when stored at room temperature or in a cool, dry location.

●       Jellied candies – If the packaging has been opened, soft candies should be stored away from heat and light at room temperature (about 70 degrees). Stored in this manner, the candy should last 6-9 months. If the packaging has not been opened, soft sweets will last approximately 12 months.

●       Candy corn – If the packaging has been opened, candy corn should be stored under the same conditions as soft candies and will last approximately 3-6 months. Unopened packages will last about 9 months.

●       Gum – As long as the packaging remains sealed, most gum products have a shelf life of 6-9 months. To maximize freshness, keep chewing gum packages in a cool, dry place and out of any direct sunlight.

●       Caramel – Caramel treats should be kept covered, away from heat and light at room temperature. Stored properly, caramel should last 6-9 months and even up to 12 months in some cases.

However, Eifert stressed that if you don’t know what conditions the candy was stored in, it doesn’t look or smell right, or it has mold growth, it’s probably best to throw it out, just to be safe.