In practice most people, especially at non-Tropical latitudes or who don’t spend multiple hours outside everyday don’t get nearly enough.
If you've got a daytime job, live above the Arctic circle or immigrated, then your only option is to eat vitamin D-rich foods or eat supplements.
Because of the thickness of the atmosphere when the sun is at lower altitudes you will only start to get enough UV-B penetrating when the sun is at an angle of >=35 degrees. If you are within 35 degrees of equator you can get UV-B every day, but outside of these latitudes there are many months where there's just not enough solar hang time high enough in the sky to deliver any meaningful amount of UV-B.
The shitty part is, the whole time and more you're still getting UV-A, which is a known cancer risk. Depending on your clothing, skin pigment, weight, and age, UV-B uptake may be significantly reduced (up to 6x for dark skin pigment, 2x for age over 50).
So while you can get UV-B from the sun in mid-day at the right latitudes, most people benefit from supplementing.
Good info at the D-Minder app site: https://dminder.ontometrics.com/
I think what I've learned from this is supplement, supplement, supplement.
I thought it was 'via diet', it's just that sunlight is necessary for the extraction/absorption?
Sort of like carbohydrate in a plant is 'generated via sun light' (photosynthesis) - but other inputs, carbon dioxide & water, are necessary too.