Vitamin D is vital for proper immune function, but many Americans don’t get enough of it—particularly during colder months, when viruses circulate more widely but people stay indoors and the sun’s rays are less effective at helping the body produce vitamin D. That’s where supplements can help. While there’s no ideal time of day to take vitamin D for immune support, factors beyond timing may still make a difference.

To be clear, taking vitamin D won’t lessen the severity of an illness or shorten its duration—getting enough of the nutrient simply helps the immune system function better overall. And when it comes to the best time to take it for immune support, the good news is that you won’t have to stick to a rigid schedule. “There’s no strong evidence that time of day significantly impacts immune benefits,” Morgan Walker, MS, RD, LDN, a sports dietitian and adjunct instructor at Lebanon Valley College, told Health. 

What’s more important for the immune system than timing is taking vitamin D consistently throughout the year—not just when you’re sick, Walker said.

Time of day does matter, however, if you’re trying to get more vitamin D through sun exposure. Some research indicates five to 30 minutes of sun between 10 a.m. and 4 p.m. on the arms, hands, legs, and face at least twice a week is enough to boost vitamin D.

“Sun exposure timing should strike a balance between enough to get some vitamin D, but not too much to cause premature aging or increased risk of skin cancer,” advised registered dietitian Amy Davis, RDN.

Vitamin D is fat-soluble, so taking it with foods that contain healthy dietary fat can improve absorption. “It’s best to take it with a meal, although the time of day is not important,” Davis told Health.

The type of vitamin D also matters. Vitamin D3 is better than vitamin D2 at raising and maintaining vitamin D levels in the blood, Walker said.

Adults need 600 international units (IU) of vitamin D per day, or 800 IU for those older than 70. While you can get vitamin D from the sun (even when wearing sunscreen) and through your diet, only a limited number of foods, such as fatty fish and egg yolks, contain it. “It can be tough to get enough vitamin D from food alone,” David said. 

Supplements can help fill any gaps, but experts recommend talking with a doctor before starting one. 

People who regularly eat vitamin D–rich foods and get consistent sun exposure may not need to supplement. However, those who follow vegetarian or vegan diets, have limited access to the sun’s rays, or have darker skin—which contains higher levels of UVB-blocking melanin—are at increased risk for a deficiency.

Walker said people in these higher-risk groups, as well as those who experience frequent illnesses, should consider getting their vitamin D levels checked.

If supplementation is needed, Davis recommended choosing a vitamin D3 supplement. “A great choice is vitamin D3 + K2, since these two nutrients work together not only for immune support, but also bone health and healthy circulation,” she said.