 If you have major depression, it may take up to two to five weeks before you notice improvement. Vitamin D is also known as the sunshine vitamin because it is made in the skin when it's exposed to sunlight. Studies suggest that vitamin D may have protective effects against everything from osteoporosis to cancer to depression to heart attacks and stroke.