How can energy be used at night when the Sun is not shining?
Energy from the Sun can reflect off the Moon.
Stored energy from daytime can be used at nighttime.
There are other sources of energy besides the Sun.
Sun is always providing energy all the time.