Ask any shift worker: You never get used to it. Working all night and sleeping during the day stresses your body. And just about the time workers' bodies begin to adapt, shifts change again.

Shift work has been associated with an increased risk of health problems, including diabetes, heart disease, and stroke. It has also been linked it to weight gain; now we know a little more about why.

Fourteen healthy adults volunteered to go through a simulated pattern of night shifts and day shifts in a laboratory setting for six days. Their sleep patterns were analyzed, as well as their energy use, nutrient use, and hormone levels.

What can shift workers do to offset the potential for weight gain? Eat healthy foods and find time for exercise when working the day shift. Pack healthy foods to take to work when on the night shift so the vending machine isn’t the only option available.

Study participants were all given the same amount of food they would have eaten at home to maintain their weight. When they went on the night shift, the food and total calories remained the same though the timing of the meals changed.

What also changed was the amount of energy they burned. Energy use fell by four percent on the first night shift, and then by an additional three percent on the next two night shifts when compared to the day shift. The "night shift" volunteers also used less protein and carbohydrate.

However, shift workers burned more fat when they slept during the day than at night. The researchers believe this may be because in the transition day between shifts, people often take an afternoon nap to prepare for the first night shift, but they are awake more hours than normal and burning more calories. Fat may meet this extra demand for energy.

Despite the initial use of fat as an energy source, energy expenditure was lower over the three days of the night shift.

The researchers believe that the reduced energy expenditure during the night shift is likely associated with the disparity between the person’s activities and their circadian clocks, which is largely set by sunlight exposure.

“Shift work goes against our fundamental biology,” said Kenneth Wright, associate professor at the University of Colorado and senior author of the study in a statement.

“Shift work requires our biological day to occur at night and our biological night to occur during the day and that's very difficult to achieve because the sun is such a powerful cue. We can have some change in our clock — a couple of hours — but then on days off, it goes right back. Shift workers never adapt.”

Approximately four million people do shift work. Research has shown that those working the night shift tend to eat poorer diets since the food available to them during the night tends to be limited to what they can get from a vending machine.

What can shift workers do to offset the potential for weight gain and weight-related diseases like diabetes?

Eat healthy foods and find time for exercise when working the day shift and on days off. When on the night shift, pack healthy foods to take to work so the vending machine isn’t the only option available. Spread those foods out through the night to keep energy levels up and avoid overeating.

“…[I]t's perhaps even more important to have a healthy diet for shift workers as well as a healthy amount of physical activity,” Wright added.

The study was published in the Proceedings of the National Academy of Sciences.