I saw a prominent neuroscientist, Andrew Huberman, interviewed recently. He mentioned that although people should be careful of skin cancer when going into the sun, it is fine to go out in the morning because the UVA rays are much lower and it helps set the body clock for the day/evening. There are also, of course, the health benefits from Vitamin D. He also mentioned that even when it is cloudy you can still get the benefits.