A light dependent resistor (or CdS photosensor) will do what you want.
Since you mention a program, it suggests you have a microcontroller. It will keep time. It has an output terminal which will produce a voltage you can adjust via programming.
Send that voltage to an led (through a safety resistor). The led shines on the LDR. Vary the led brightness so that it causes 10 to 100 ohms resistance in the LDR.
If it won't go as low as 10 ohms, then connect a few of them in parallel.