" It's important to know that vitamin D is not obtained from the sun just anytime, anywhere. So, the rule of thumb is that if the sun is not at least 45 degrees above the horizon you are not going to be able to get any vitamin D because the ozone in the air is thick enough that the UV-B rays don't get to you. So you can still get sunburn from the UV-A rays but the UV-B rays that help provide vitamin D are not accessible to you.
If you want to know if you're getting vitamin D or not it's very simple:
When you're outside, look at the ground; look at your shadow. If your shadow is not sharp and shorter than you are tall, you are not getting significant amounts of vitamin D. "