For me, better mental, cardiovascular, immune, and bone health is more important than apparent skin aging and a marginally increased risk of skin cancer, but everybody has to make their own trade-off decisions. A moderate amount of sun exposure is beneficial to most people. Avoid burning—especially severe burns with kids, which seem to be a big factor in eventual skin cancer risk—by controlling length of exposure and by wearing clothes to cover your skin if you can't control length of exposure.
Parameters that affect exposure time to produce a certain amount of vitamin D:
* Date, time
* Location
* Skin type
* Body exposure
* Clouds
* Ozone
* Elevation
* Surface
Here is a calculator from the Norwegian Institute for Air Research:
https://fastrt.nilu.no/VitD_quartMEDandMED_v2.html
https://fastrt.nilu.no/README_VitD_quartMEDandMED_v2.html
In addition, vitamin D requirements and synthesis might vary between people and health status.
I think it renders the approach to calculate sun expose time unreliable and, probably, useless for most people. Are there other ways? Can I reliably measure my current and required levels of vitamin D, ideally without going to the doctor every week? Or could I just rely on common sense - make sure I spend time outside, but avoid exposing my skin for longer than 30 mins on sunny summer days?
Determining vitamin D levels will vary by country. You’d have to research how it works.
I’m not aware that healthy people can get too much vitamin D from the sun. In combination with the many beneficial effects of natural light (see melatonin, circadian rhythm, mood, etc.), maximizing time outside without burning seems like the best strategy to me. I just find it easier to avoid getting sunburn with the above calculator. Day-by-day variations are small enough that you might be able to make educated guesses most of the time and not check every time you go outside.
If this collides with one’s life (e.g. work-hours), supplements could be considered, but those come without the other effects of natural light.
To check the current UV index and ozone column: