People call vitamin D the “sunshine vitamin” because we make it when sun hits our skin. Which makes it technically not a vitamin (vitamins, by definition, cannot be made by the body, but must be obtained through the diet).
The whole “vitamin/not vitamin” thing is one of many misconceptions we’ve held about this crucial nutrient. We’ve also been wrong about how much to take, what kind to take, and what it does for us when we take it. Which is to say, we’ve been wrong about just about everything about vitamin D!