A SPDT relay with a low-voltage DC coil driven with one or more solar cells (however many are needed to provide sufficient voltage to energize the relay coil) can be used to switch between daytime and nighttime operation.
The power source is connected to the moving contact of the relay, the nighttime load is connected to the normally-closed contact, the daytime load is connected to the normally-open contact. When daylight illuminates the solar cell(s), the relay is energized and power is applied through the (now closed) normally-open contacts to the daytime load. At night the relay coil is de-energized and power is applied through the (now closed) normally-closed contacts to the nighttime load.