Jerry Seinfeld used to have a joke about his two warring halves: “Night Guy” and “Morning Guy.” “Night Guy” wants to stay up late, and “Morning Guy” really wishes he’d gone to bed earlier. Some of us share a similar dualism in our eating habits. While our morning selves are usually able to find contentment with light, nutritious meals, our nighttime personas just can’t get enough potato chips and pints of ice cream.

READ MORE: Is Your Snacking Out of Control?

An April 2013 study in the journal Obesity offers an explanation for our dueling selves. A group of researchers from Oregon Health & Science University, Harvard University and Brigham and Women’s Hospital concluded that, thanks to our circadian system—aka our internal body clock—we’re hungriest a few hours before bed time and the least hungry when we wake up.

“We’ve uncovered a rhythm in appetite that we didn’t previously know existed,” says the study’s senior author Steven Shea, Ph.D., director of the Center for Research on Occupational and Environmental Toxicology at Oregon Health & Science University.

The researchers asked a group of adults to spend 13 days in a laboratory on a strict food and activity regimen. The subjects had to rate their appetites throughout the day. Shea and his colleagues found that people felt hungriest around 8 p.m. and the least hungry around 8 a.m. Their desires for sweet, salty and starchy foods, fruits and meat followed a similar pattern.

Shea thinks that the desire to fill up on food before bedtime may have worked well for our ancestors. “I can understand evolutionarily why it became this way—you don’t know when food will come the next day so it’s like a bank,” he says. A suppressed morning appetite can also help you sleep through the night and wake up able to focus on other tasks besides eating, notes Shea. But given the abundant food and late bed times of the Western world, late night cravings may be a recipe for obesity.

READ MORE: Healthy Desserts That Won’t Derail Your Diet

While Carla Wolper, R.D., a nutritionist and professor at the Center for Eating Disorders at Columbia University Medical Center, would like to see this research examined further—Shea’s study only looked at 12 individuals—she acknowledges that a lot of people have trouble with nighttime eating.

“Your body doesn’t care what time you eat the food,” she explains. “However, if people tend to restrict their eating throughout the day and eat a lot at night, those people tend to be overweight.” In other words, if you come home to the comfort of your house after a busy day and you’re famished, you’ve set yourself up to overeat.

Whether or not we’re biologically programed to be hungrier at night, you don’t have to cave into your body’s after-dark food cravings. Wolper sees meal planning as the best defense against late night splurges. That means plan to eat enough during the day, plan a satisfying dinner, and plan a healthy after-dinner snack. Wolper also stresses removing high-calorie, addictive foods from your home if you know you’re prone to binge. “It’s the same advice you’d give a drug addict,” she says. “Don’t keep heroin in the closet. Get better replacements that are lower in calories.”

READ MORE: Healthy Foods to Satisfy Common Cravings

Registered dietitian Heather Bauer, founder of the nutrition subscription service Bestowed, sees a lot of clients struggle with late night eating as their main cause of weight gain. She’s noticed that for true nighttime-eaters, a bigger breakfast doesn’t seem to deter the impulse to grab a twilight snack. But Bauer says that eating a later dinner can help curb the before-bed munchies.

“A night eater should try to eat dinner closer to 8 p.m.,” she suggests. Just be sure to give your body an hour or two to digest before going to bed.

Bauer tells clients who want to break the late night snack cycle that they can have a 60- to 80-calorie snack, such as a piece of fruit after dinner, but only if it’s within half an hour of eating. She’s partial to fruits that take a long time to eat and therefore slow down your munching, such as grapefruit, sliced apples or mango.

The truth is, many people who crave a late night nosh are, in fact, just bored or anxious, and food can make you feel better—or at least, take your mind off things. But if your stomach is growling and you’re still truly hungry later at night? Bauer recommends a healthy protein snack, such as a slice of low-sodium turkey or hard-boiled egg whites to take the edge off without filling up.

READ MORE: 8 Tips for Drinking Less Without Your Friends Knowing