The dimmer code for the two outputs looks correct.
But i do not know how to code to get it time switch.
Set the time alarms for when want to change the dimming values. The alarm function should set the values. In your time alarms example, morning alarm would set dimming1 and dimming2 instead of the serial print statment.
Can you write down a table of the times and dimming values you want?