Weight gain also depends on our own body clock or circadian rhythms.
Persistent exposure to light during the hours of darkness changes your metabolism and makes you pile on the pounds even without any change in the amount you eat, researchers have found.
They discovered that staying up later often led to a change in eating habits with much more food eaten at night when the metabolism is slowing down.
Evidence suggests shift workers are more prone to heart disease and diabetes.
Researchers found mice exposed to a relatively dim light at night over eight weeks had gained a third more weight than those in a standard light-dark cycle.
Laura Fonken,a neuroscientist at Ohio State University, said: “Although there were no differences in activity levels or daily consumption of food, the mice that lived with light at night were getting fatter than the others.”
The findings published online in Proceedings of the National Academy of Sciences suggests there is a “wrong” time to eat.
Weight gain is clearly not just calories in and calories out but also depends on our own body clock or circadian rhythms.
Dr Fonken and colleagues said the mice were not less active or consuming more food – but that they ate at different times.
Study co-author Prof Randy Nelson said: “Light at night is an environmental factor that may be contributing to the obesity epidemic in ways that people don’t expect.
“Societal obesity is correlated with a number of factors including the extent of light exposure at night.”
For example, researchers have identified prolonged computer use and television viewing as obesity risk factors, but have focused on how they are associated with a lack of physical activity.
Prof Nelson said: “It may be people who use the computer and watch the TV a lot at night may be eating at the wrong times, disrupting their metabolism.
“Clearly, maintaining body weight requires keeping caloric intake low and physical activity high, but this environmental factor may explain why some people who maintain good energy balance still gain weight.”
In one experiment mice exposed to light at night – but that had food availability restricted to normal eating times – gained no more weight than did those in a normal light-dark cycle.
Prof Nelson said: “Something about light at night was making the mice in our study want to eat at the wrong times to properly metabolize their food.”
He said if the results are confirmed in humans it would suggest late-night eating might be a particular risk factor for obesity.
“When we restricted their food intake to times when they would normally eat, we didn’t see the weight gain. This further adds to the evidence that the timing of eating is critical to weight gain,” Ms Fonken said.
Tam Fry, of the National Obesity Forum, described a new study suggesting eating late at night can make you pile on the pounds as “very interesting”.
He said: “Timing of eating is very significant.
“We have been advising people for a long time an early dinner can help keep their weight in trim as opposed to a late one which leads to food sitting for the rest of the night.”