To add to the other replies, it depends on various factors (sun elevation being the most important). This is the best calculator I am aware of: https://fastrt.nilu.no/VitD_quartMEDandMED_v2.html
There are other related calculators linked also.
There are other related calculators linked also.
Vitamin D production is only made on the UVB range that is highest at midday. Both UVA and UVB causes erythema. Counterintuitively to common sense, it is better to sun bath midday than early in the morning.
If you sunbath at 8 you might need twice as many time to produce the same amount of vitamin D and you be exposed to much more UVA, thus more like to get burn.