We all know that drinking coffee or energy drinks in the evening is probably a silly thing to do, but lots of us do it anyway to avoid being sleepy until we absolutely have to be. And now we have even more evidence for why this is a bad idea – researchers have shown for the first time that consuming caffeine in the evening can delay people's internal circadian clock that lets us know when it's time for bed and also when to get up in the morning.

According to a new study, the amount of caffeine in a double espresso taken 3 hours before going to sleep can induce a phase delay of 40 minutes that disrupts our usual 24-hour biological sleep clock.

"The effect of caffeine on sleep and wakefulness has been long established, but its impact on the underlying body clock has remained unknown," joint lead author, John O'Neill from the MRC Laboratory of Molecular Biology in the UK, said in a statement. "By understanding the effect caffeinated drinks have on our body clock, right down to the level of individual cells, [it] gives greater insight into how we can influence our natural 24 hour cycle – for better or for worse."

Circadian rhythms are the 24-hour cycle of biological processes that regulate our sleeping and waking. They're found in plants and animals in addition to humans, and are highly responsive to environmental conditions, like light.

To assess the effects of caffeine on circadian rhythms, the researchers recruited five volunteers to take part in a 49-day protocol where they were tested under four sets of sleeping conditions: low light with a placebo pill; low light with a caffeine pill (the equivalent of 200 mg, dependent on the subject's weight); bright light with a placebo pill; and bright light with a caffeine pill. Saliva samples were taken to track melatonin levels – the sleep hormone controlled by our brain's internal sleep clock.

The researchers found that the participants who took the caffeine pill in low light conditions experienced a roughly 40-minute delay in their circadian patterns compared to those who took the placebo in low light conditions. The effect is also worsened if caffeine consumption is combined with bright lights, extending the sleeping delay to 105 minutes.

"These findings could have important implications for people with circadian sleep disorders, where their normal 24-hour body clock doesn't work properly, or even help with getting over jet lag," said O'Neill. "Our findings also provide a more complete explanation for why it's harder for some people to sleep if they've had a coffee in the evening – because their internal clockwork thinks that they're an hour further west."

Given the unpleasantness of jet lag, the research could offer a shortcut to resetting your body clock for frequent travellers. If you're travelling west, for example, it might be possible to use caffeine to help your body adjust to the time at your destination. But if you're travelling east, you might want to consider avoiding caffeine altogether.

The research is published in Science Translational Medicine.