What about “tan-in-a-bottle” lotions?

Two primary sources of vitamin D are the diet and cutaneous UVB exposure. The inactive form of vitamin D (7-dehydrocholesterol) contained within epidermal keratinocytes is converted photochemically by UVB radiation to previtamin D3. Previtamin D3 then spontaneously isomerizes to vitamin D3 (3-cholecalciferol). Vitamin D3 is then hydroxylated by the epidermis and the liver to 25-hydroxy vitamin D3, which is then further hydroxylated to the active form 1,25-hydroxy vitamin D3 or calcitriol.

Anything that interferes with ambient UVB levels (latitude, time of day, season of the year, cloud cover, smog) or cutaneous UVB penetration (clothing, melanin, sunblock) will reduce vitamin D production.