And if this is disturbed then it is easy to put on weight.
The US researchers studied mice but they believe that people can benefit from timing their meals to be in tune their body clock.
Professor Carl Johnson, of Vanderbilt University in Nashville, carefully measured levels of insulin - a hormone which plays a key role in the conversion of the sugar in our food into energy - and found that rather than amounts of insulin staying relatively constant over time, there was a clear pattern, with the animals finding it harder to deal with sugar when they'd usually be asleep.
He discovered that in the animals' whose body clocks were sent haywire, the pattern vanished, and sugar posed a problem day and night, the Daily Mail reported.
The findings also showed that these creatures also put on much more fat than usual.
The study suggests that if food is eaten at the wrong time of day, the body stores more fat.
Johnson said that the biological clock controls metabolism, so the way in which we metabolize the same foods during the day and night is different.
He asserted that if people metabolized food during the day, when they are active, they tend not to convert so much of that to fat but food that is eaten during the night or late evening is more likely to be converted into fat.
Johnson said that if the body clock is disrupted by shift-work, the same kind of thing can happen.
He added that better timing of meals won't turn the tide of obesity but it will probably help.
The findings have been published in the journal Cell.