Scientists in the United States studied 30 adults who were overweight.
They gave all the people the same food and the same number of calories.
But one group finished dinner at the usual time, and the other group ate after 10 p.m.
After the late meal, blood sugar went up 1.2 times more than in the early group.
Insulin, the hormone that lowers sugar, worked less well.
People who ate late burned less fat and stored more of it.
This may happen because the body makes more melatonin late at night, and melatonin can slow insulin.
The scientists say that people who are overweight should eat dinner earlier and skip late-night snacks.
This can help control blood sugar and stop extra fat from building up.