Being exposed to light during a certain time of day can increase a person’s risk of developing Type 2 diabetes. According to the science, it all comes down to how you sleep.

Published in the Lancet Regional Health — Europe earlier this month, a study helmed by Flinders University researchers in Australia discovered sleep disruption can play a significant role in diabetes development.

“We found that exposure to brighter light at night was associated with a higher risk of developing type 2 diabetes,” senior study author and associate professor at the university’s College of Medicine and Public Health Andrew Phillips said in a news release.

“Light exposure at night can disrupt our circadian rhythms, leading to changes in insulin secretion and glucose metabolism,” he continued. “Changes in insulin secretion and glucose metabolism caused by disrupted circadian rhythms affect the body’s ability to regulate blood sugar levels, which can ultimately lead to the development of type 2 diabetes.”

Researchers analyzed information from around 85,000 people and 13 million hours of light sensor data to determine being exposed to light from 12:30 a.m. to 6 a.m. increased diabetes risks in participants. The participants did not have Type 2 diabetes at the beginning of the trial, which ran for nine years.

For a near decade, in the largest known study of its kind, the scientists monitored the participants to observe who developed the disease.

“The results showed that exposure to brighter light at night is associated with a higher risk of developing diabetes, with a dose-dependent relationship between light exposure and risk,” Phillips said. “Our findings suggest that reducing your light exposure at night and maintaining a dark environment may be an easy and cheap way to prevent or delay the development of diabetes.”