Asked for a general recommendation, Dr. Holick suggests going outside in summer unprotected by sunscreen (except for the face, which should always be protected) wearing minimal clothing from 10 a.m. to 3 p.m. two or three times a week for 5 to 10 minutes.
Slathering skin with sunscreen with an SPF of 30 will reduce exposure to ultraviolet-B rays by 95 to 98 percent. But if you make enough vitamin D in your skin in summer, it can meet the body’s needs for the rest of the year, Dr. Holick said.
Personally I'd rather take a supplement than risk skin cancer later in life from sun exposure. There is definitely a tradeoff between the natural technique of acquiring vitamin D and the safe way. Getting vitamin D via sunlight on the skin was safer when we had more ozone and fewer ultraviolet rays.