It was a rough day, but now you can settle in for a little television — and a delicious late-night snack. But is that midnight treat just a harmless reward or a dangerous habit that will pile on the pounds?

For years, experts have debated whether eating late at night boosts your risk for gaining weight. Some experts insist that a calorie is a calorie no matter when you eat it, and what counts is keeping calories under control and eating a healthy diet.

However, the results of several new studies challenge that thinking. In one of the most recent, researchers from the Salk Institute for Biological Studies found that restricting eating within a nine- to 12-hour window every day, like our ancestors did, is linked with leanness, even if the diet is high in fat.

There's one catch, though. The Salk study was on mice, and its lead researcher, Satchidananda Panda, PhD, says he cannot say with certainty yet whether the findings would apply to people. More data is needed first, he says.

Eating within a window

Even so, the 38-week study produced interesting results, echoing some studies that have produced similar findings in people. Panda's team found substantial weight differences in the animals who ate at will compared to those who ate within a restricted time period, even though they ate the same total amounts. The researchers gave nearly 400 mice — some normal weight, some obese — different types of diets and allowed them access to that food at different time periods.

Those who were confined to eating during a window of nine to 12 hours gained less weight than those who were allowed to eat whenever they wished, and this was true even if the diet was high in fat, Panda found. When the window for eating was expanded to 15 hours, the benefits declined. The findings are published in the journal Cell Metabolism. However, the approach seems to have a fudge factor. When the researchers gave some of the restricted mice a weekend off, there wasn't much difference in weight gain compared to those who were restricted every day.

The restricted eating also helped the overweight mice shed pounds quickly. They dropped five percent of their starting weight within a few days of eating in a nine-hour window, even though they ate the same amount as before. Restricting eating to specific hours may help undo the damage that occurs in the body once obesity-related problems like high blood pressure set in, the researchers speculate.

RelatedShould You Say Sayonara to Sugar?

Double whammy: Late dinner, no breakfast

Besides the Salk study, other studies have concluded that when you eat may matter when it comes to your weight. Japanese researchers looked at the eating habits of more than 60,000 adults, ages 20 to 75. Those who reported the two habits of skipping breakfast and eating dinner late were more likely to be obese than those without these habits, researchers reported in 2014 in Scientifica.

Can’t sleep? Don’t binge

Australian researchers asked 330 men and women to report their height and weight, how well they slept and whether they ate late at night or binge-ate. The link between poor sleep and overweight is already known. In this study, researchers found that those who reported worse sleep also binged late at night, leading to weight gain. Those who can't sleep may binge-eat as they wait for sleep to come, helping to explain their weight problem, the researchers suggested in a report published in 2014 in Eating Behavior.

Related: Want to Live Longer? Eat a Mediterranean Diet

Irregular eating times, bad news on the scale

Researchers from Northwestern University also found eating during typical sleeping times can lead to weight gain. They fed two groups of nocturnal mice a high-fat diet, letting them eat as much as they wanted during a 12-hour feeding period.

For one group of mice, that 12-hour period was at night, their typical feeding time. For another, it was during daylight, which was not their typical eating time. Both groups averaged the same amount of food and the same levels of activity. Those fed during their normal eating time gained 20 percent of their starting weight, but those who ate during their normal sleeping time gained 48 percent of their starting weight, the researchers reported in 2009 in Obesity.

Explaining the links

Timing of eating may matter, experts speculate, because eating at unusual times may disrupt our body's internal circadian system. The timing of eating may affect how well we do or don't burn fat, some experts believe. Recently, scientists found organs related to food intake, such as the stomach or intestine, have an active circadian clock.

So, around midnight, when you think that bag of chips is a private, no-one-needs-to-know moment, your gut and its clock may already be onto you.

RelatedThe Skinny on Carbs: Are They Diet Friends or Foes? 

Kathleen Doheny is a Los Angeles journalist specializing in health, behavior and fitness topics.