If you’ve ever had a fly buzzing around your home — and who hasn’t? — you know how frustrating this can feel. Fly swatter in hand, you rip your house apart attempting to get at the annoying insect who manages to stay just out of reach. At least you can rest secure in the knowledge that it’ll be dead within 24 hours. Right?

Think again!

Rumor has it that houseflies (Musca domestica) are a very short-lived pest in the common household, but it turns out these little insects have more than a mere 24 hours to eke out their lives, steal a little food, and pass on their genes to the next generation of maggots. According to entomologists, houseflies live for upwards of 20 to 25 days. What’s more, in some instances, they’ve been documented to live for up to 30 to 60 days!

The Intricate Life Cycle of a Housefly

Like other types of flies, the common housefly goes through an intricate life cycle that involves a variety of stages. Remember The Fly (1986) or The Fly II (1989)? Neither one of those nasty transformations happened overnight either.

The fly life cycle starts with a female housefly laying eggs that look like tiny grains of sand. On average, each female can lay 150 eggs at one time, and she does so on rotting wood or flesh. These eggs hatch into nasty white larvae known fondly as maggots. Maggots have ferocious appetites and devour every unsavory thing you can imagine, growing fatter and fatter in the process. The larval stage can last anywhere from a few hours to a couple of days. Then, they enter the “pupal” phase.

During the pupal phase, maggots go through a fundamental structural transformation. Their skin changes from white to red, black, brown, or yellow, and their bodies lose their cylindrical shapes. They grow hardened outer casings. Not to be confused with cocoons, these shells allow the maggots to lay dormant while more changes happen.

While chilling in their shells, they develop legs, wings, and all of the other features associated with the common housefly. Once the process is complete, the fly breaks free of the casing and embarks on a search for food and a mate so that they can start the life cycle all over again.

It’s a Fly’s Life

How long does the transformation take from birth to fly “dating”? According to the World Health Organization, it requires six to 42 days for a fly egg to develop into a fully functional adult. The pupal stage alone takes between two and 10 days, and adult flies need a few additional days before they can reproduce.

Why the large variation in timeframe? The life cycle ultimately comes down to ambient temperatures.

In both the larval and pupal phases, they can overwinter in protected areas such as manure piles, and the process can drag on for up to two months. But in optimal summer conditions with warm temperatures, flies complete their life cycle in little more than seven to 10 days.

This can translate into nasty infestations. For example, in temperate regions, as many as 10 to 12 generations may occur each year. This skyrockets to 20 generations in subtropical and tropical regions.

The 24-Hour Fly Myth

In Pixar’s A Bug’s Life, a disgruntled housefly exclaims, “I’ve only got 24 hours of living, and I ain’t gonna waste ‘em here!” While it makes for a hilarious line, common houseflies live much longer than 24 hours as you can see by the intricate life cycle outlined above.

So, how did this whole myth get going in the first place?

More than 120,000 different species of flies exist in the world. Of these, 3,000 species are known as mayflies. After living aquatically as larvae known as nymphs or naiads for one to three years, mayflies emerge from the water with the sole goal of reproducing. They don’t even have functional mouths and perish within one to 24 hours.

What’s the takeaway from all of this? Keep that fly swatter handy. Just remember to leave those poor, love-crazed mayflies alone!

By Engrid Barnett, contributor for Ripleys.com