Yes, Solar energy can still generate energy when it is cloudy, rainy, or snowy, even at night.

As long as there is sunlight outside your solar panels will generate energy, even in small amounts. During the night the sunlight reflected by the moon can even generate small amounts of energy.

Source: Department of Energy