Yes, exposure to the sun is necessary for Vitamin D ... but it has to be SAFE exposure, which I believe is why they give those safe sun exposure times during weather forecasts ...
JMHO
BTW, I couldn't help but notice the irony of the title of the post ...