Can I get vitamin D from the sun?

The theory is that it is possible to get enough vitamin D if there is enough sun exposure, so it is recommended that children be exposed to the sun around 9am to 10am and 3pm to 4pm.
However, the American Academy of Paediatrics advises that infants under 6 months of age should not be exposed to excessive direct sunlight as it may increase the incidence of skin cancer, and therefore recommends that children should avoid direct exposure to the sun as much as possible and receive sun exposure to their skin outdoors in the shade.
In addition to sun exposure in the daily routine, parents are still encouraged to take care of the essential vitamin D supplementation for infants and young children through food or supplements.