Exposure to sunlight serves no real purpose in medical terms. Exposure to the sun for vitamin D requires prolonged exposure of the entire body for long periods like several hours which is impractical. The amount of vitamin D from this is pretty small and therefore not a major source of vitamin D. With small babies there is a risk of overheating and sunburn if the sunlight is intense.