This is an arena of mis-information in which the paleolithic model is informative. There are those who would pretend to "know" that any amount of sun exposure is "damaging." This is obviously true, to a degree. All food has a degree of toxicity, which is injurious or nourishing based on the dose. Too much water will kill you.
But the idea that we should avoid all sun exposure does not stand up to the test of the paleolithic model of nutrition. Those people were not known to have cancers, but they had no sunscreen and they had no fear of daylight. I suspect they were smart enough to avoid sunburn.
The one way the model breaks down is the problems that were created by our present ethnic dispersion, away from the locations for which our genetics were optimized. Dark skinned people in northern climes will have problems making any vitamin D, and light skinned folks spending time close the equator are going to have problems with sun damage if they take any risk at all.
Use your number one survival adaptation, your brain, and get the right dose of sun just like you have to get the right dose of protein, fat, and carbs - none of which is natural in the neolithic world.