When should you take your last coffee of the day?
We know that drinking coffee at night is a bad idea but a new study recommends a six-hour gap between our last coffee of the day and bedtime.
So if you don't want to be counting sheep after 11pm, you best take your last sip no later than 5pm that day.
The study, published earlier this month in Science Translational Medicine, played with five people's sleeping habits.
Over the course of approximately 49 days, the participants were given a capsule containing the equivalent of a double shot of espresso (with the amount adjusted to their body size), a placebo pill and exposure to bright light three hours before bedtime.
The three conditions were tested at different times so the researchers could compare reactions within the same subjects.
Results showed that the caffeine appeared to delay the body clocks of the study participants by 40 minutes, about half the delay linked to exposure to bright light.
It appears that coffee at night "isn't just keeping you awake," said study co-author and sleep researcher Kenneth Wright Jr.
"It's also pushing your [internal] clock later so you want to go to sleep later."
So when is the best time to drink coffee if you want to catch up on your sleep?
According to Wright, removing coffee from your diet or just having it in the morning might help you achieve earlier bedtimes.