It’s not just what we eat, but when we eat it, that can set us up for weight gain. Circadian rhythms rule how our bodies deal with eating just as they rule so many other bodily functions. Our bodies function best when we follow the daily patterns that tell our bodies when to wake up, when to eat and when to fall asleep. Studies show that eating late at night or indulging in midnight snacks can point toward metabolic trouble.

The latest discoveries lead one expert on circadian rhythms to propose that people abandon grazing throughout the day and adopt a practice called early time-restricted feeding. Limit eating to a daily 8- to 10-hour window that starts in the morning and ends by early evening, recommends Salk Institute professor Satchin Panda in his new book, “The Circadian Code.”

Most people stretch out eating over a period that can last 15 hours or longer, the researcher says he found. They start with breakfast upon waking and continue throughout the day with meals before finishing off late at night with a snack.

That pattern of eating, he says, is at odds with our innate biological rhythms. A couple of decades ago, researchers discovered that every organ has an internal clock that governs its daily cycle of activity. In every organ, an internal clock switches thousands of genes on and off at roughly the same time every day.

Human metabolism is set to a daily clock that dictates prime time for food intake is morning and afternoon. That’s when our hormones, enzymes and digestive systems function at their best. The pancreas pumps out an increasing amount of the hormone insulin as the day goes on to control blood sugar levels, and then slows the production of insulin at night.

Enzyme production, nutrient absorption and waste removal are all regulated by the gut’s clock. The trillions of bacteria that make up the microbiomes in our guts adhere to a daily rhythm.

Dozens of studies show that we burn more calories and digest food more efficiently in the morning. Research also demonstrates that our bodies control blood sugar best in the morning and worst in the evening. That’s part of the evidence that consuming the bulk of your food earlier in the day is better for your health.

“We’re designed to have 24-hour rhythms in our physiology and metabolism. These rhythms exist because, just like our brains need to go to sleep each night to repair, reset and rejuvenate, every organ needs to have down time to repair and reset as well,” says Dr. Panda.

Recent discoveries about the collection of clocks in the body have added to knowledge about our daily cycles of activity. Scientists have long known that a master clock in the brain’s hypothalamus responds to exposure to bright light and tells us when to wake up and when to go to sleep.

Read more: When We Eat, or Don’t Eat, May Be Critical for Health