The key point to understand is that sunlight is composed of about 1500 wavelengths, but the only wavelength that will have your body make vitamin D are UVB-rays when they shine on unexposed skin.
The key is that the UVB-rays from the sun actually have to pass through the atmosphere and reach where you are on the earth. This obviously does not occur in the winter for most of us, but the sun’s rays are also impeded during a fair amount of the year for people living in temperate climates.
So how do you know if you have entered into the summer season and into the time of year, for your location, where enough UVB is actually able to penetrate the atmosphere to allow for vitamin D production in your skin?
It should be noted that this represents a very small portion of the total radiation from the sun that reaches the earth’s surface. Much is filtered out by our atmosphere. So due to the physics and wavelength of UVB rays it will only penetrate the atmosphere when the sun is above an angle of about 50° from the horizon. When the sun is lower than 50°, the ozone layer reflects the UVB-rays but let through the longer UVA-rays.
The first step is to determine the latitude and longitude of your location. You can easily do this on Google Earth, or if you are in the U.S. you can use the TravelMath Latitude Longitude Calculator to find your latitude and longitude
Once you have obtained that you can go to the U.S. Navy site to calculate a table to determine the times and days of the year that the sun is above 50 degrees from the horizon. You can find this very useful website here.