Your skin makes vitamin D when UVB photons hit 7-dehydrocholesterol in your epidermis and convert it to previtamin D3. The catch: UVB only reaches the ground when the sun is high enough — roughly above 45° elevation — which means the same midday window that maximizes vitamin D synthesis also maximizes sunburn risk.