The best source of vitamin D is the sun, if you can get hold
of it or if you are NOT on tx.
For fair skinned people 20 minutes is enough, as then the
skin is saturated and cannot produce more vitamin D. For darker skins more is needed. You should get out of the sun, as soon as the skin becomes slightly pink. Anything more than that can be dangerous. The more protection one uses, the less vitamin D one gets out of it.
I personally only use sun screen when I'm out on the beach.