Answer by Steven Fowkes:
Sitting in the sun, or sunbathing, can be about vitamin D production and it can be about red-light (and near-IR) irradiation. (It can also be about blue-through-ultraviolet light exposure than may modulate cholesterol sulfation and suppress melatonin.) These are quite different, and have different time constraints.
Mid-day sun exposure optimizes vitamin D production. That would be between 11 AM and 2 PM (i.e., your lunch hour). This is because the angle through the atmosphere affects how much UV-B radiation you get exposed to. At noon, the sun is highest and the atmospheric thickness lowest.
Since the atmosphere can also contain smog, which absorbs UV radiation and lessens this effect, you might not get much vitamin D on a smoggy day, even if you get sun at noon. But the blue-light effect would get through and might improve your mood if you are suffering from seasonal affective disorder (SAD).
Early morning sun exposure just after sunrise is infrared- and red-rich light and has very little UV-B. So you will get very poor vitamin-D results. But IR and red light is a photoperiod signal that “jumpstarts” your mitochondria and triggers the circadian drop in cortisol (a dark-adaptation mechanism). The same thing happens with end-of-day sun exposure (sunset), only this postpones the cortisol rise that begins with the onset of darkness.
So there are excellent health-oriented reasons for cultivation both early morning sun and noonish sun.