If you have skin conditions such as eczema or psoriasis, you've probably been told that some time in the sun could be good for your skin. A Cleveland Clinic dermatologist says this is true, but it's important to make sure you're not overdoing it.

Cleveland Clinic Dermatologist, Dr. Melissa Piliang says getting a little sun is a good idea if you have skin conditions like psoriasis or atopic dermatitis, but warns of the risks of too much sun.

"It's important to keep in mind though, the sun increases your risk of skin cancer, especially the most deadly type of skin cancer, melanoma, so you still want to be careful and practice smart sun behaviors," Dr. Piliang said.

So what is the ideal amount of time to spend out in the sun? Dr. Piliang says if you're out in the sun to help with your skin condition, try to stay out there for no longer than five to 10 minutes at a time to avoid getting sunburned.

Dr. Piliang recommends wearing broad spectrum, water-resistant sunscreen with an SPF over 30 on all areas of your body you don't want exposed directly to the sun, as well as a hat and sun-protective clothing.

While the sun can be beneficial for these skin conditions, Dr. Piliang reminds patients not to rely on it as the sole method of therapy and treatment such as light therapy and prescription medications.

"There are so many treatment options out there beyond just the sunlight or moisturizers you can buy over the counter. The dermatologist can help you get your skin clear and on a treatment that is safe and effective and you can tolerate well Dr. Piliang said.

There is currently no known cure for skin conditions like eczema or psoriasis, but Dr. Piliang says light therapy and medication can really make a difference.