An intervention trial found that supplementing veterans with vitamin D (D3) enhanced their sleep duration. Another double-blind clinical experiment found that taking vitamin D supplements (50,000 IU every two weeks for eight weeks) improved sleep duration and quality in adults with sleep disturbances. However, other studies have not shown similar effects of vitamin D on sleep. Vitamin D is involved with regulating the body's circadian rhythm, or internal clock. It does this by affecting the production of hormones called melatonin and cortisol. Vitamin D helps regulate these hormones' levels throughout the day to bring about healthy sleeping patterns. When there is insufficient vitamin D in the body, it can lead to insomnia. However, when you supplement with vitamin D, this can have the opposite effect and help people who suffer from insomnia get better quality sleep. There are several theories about why vitamin D might be linked to good sleep. One theory is that it could be because vitamin D stimulates the secretion of insulin from the pancreas which leads to lower blood sugar levels. Lower blood sugar levels mean that you will likely go to sleep more easily and stay asleep longer. Another possibility is that vitamin D may play a role in producing certain chemicals in the brain that affect how well we sleep. Scientists think that it may do this by acting on cells in the brain that make serotonin.