Did you forget to put your leftover pumpkin pie in the fridge after Thanksgiving dinner? Find out how long a pumpkin pie can sit out before going bad.

By Gina Bergman
Updated October 30, 2017
mr-Pumpkin Spice Latte Pie Image
Credit: Daniel Agee; Food Styling: Pam Lolley; Prop Styling: Audrey Davis

When you’re hosting a big dinner party—and Thanksgiving is the ultimate dinner party!—it often makes sense to make your dessert first, get it out of the way, and then focus on everything else. Because most cakes, cookies, and pies can sit out at room temperature for days, you might be in the habit of storing your dessert on the counter (or in the microwave, hidden from wandering hands). Pumpkin pie, however, should not be stored indefinitely at room temperature. So how long can pumpkin pie sit out?

How Long Can Pumpkin Pie Sit Out?

First off, understand that homemade pumpkin pies are less forgiving than, say, apple pies, because they are made of custard, with eggs and milk. You need to treat your homemade pumpkin pie like you would a quiche. According to the FDA, homemade pumpkin pie can be left at room temperature for two hours, after which it is in danger of growing harmful bacteria. Homemade pumpkin pie is safe in the fridge for 2 to 4 days, so it's best to store it there after it cools. If you want to bake your pumpkin pie weeks ahead of time and freeze it, follow our rules for successful pumpkin pie freezing and defrosting here.

Watch: How to Make Classic Pumpkin Pie

Store-bought pumpkin pies, which include shelf-stable ingredients such as preservatives, are a different story. How long can store-bought pumpkin pies sit out at room temperature? If your pie was sold unrefrigerated in the store, it can continue to be stored on your counter until the sell-by date. In general, store-bought pies last about 2 to 4 days after their printed date in the refrigerator and about 6 to 9 months in the freezer. If your pumpkin pie does not have a sell-by date, perhaps you bought it from a bakery or another place that baked the pumpkin pie in a traditional way, without preservatives. In that case, look to the homemade pumpkin pie rules above.

If you left your pumpkin pie out for too long, don’t be tempted to roll the dice. Thanksgiving is about more than just pumpkin pie. It’s about gratitude and family and friends—none of whom want to get sick.

This article originally appeared on RealSimple.com.

This Story Originally Appeared On realsimple.com