I've done a pretty deep dive into sunburn, skin cancer, etc. Lots of very interesting science out there that goes against lots of the conventional wisdom.
For example, being in the sun causes your skin to protect itself from the sun. So, for example, if you are out in the sun from 8am-1pm, you're less likely to get burned than if you were in the sun from just 11am-2pm -- all things equal. IR radiation in the morning prepares your skin for the forthcoming UV radiation. It, interestingly, has partly to do with melatonin (not melanin) contained in the mitochondira of the cells in your skin.
As another example, sun exposure is a fairly weak predictor of skin cancor generally, and skin cancer death specifically. Diet, excecise, etc. are all must more important than avoiding sun. And, shockingly, people who work outside in the sun a shit load have no high skin cancer risk than people who work in an office. Like I said, turns out the conventional widsom is fucked on this topic.
All that said, it's still worth it to avoid getting sunburn -- but you can do a lot with diet and livestyle to avoid sunburn -- not just avoid UV radiation hitting your skin.