The Ds1307 has onboard user memory - if you run the IC battery backed, you will have the current time when power is restored. Also you could store your PWM variables there as well, and be resilient to power cut corruption.

I would suggest that it may be easier to use minutes (word Var) for your calcs internally, 1440 minutes per day, 3600 secs per hour.

So for your first 14:00 - 14:30 that would be start at 840 minutes and end at 870 minutes, difference being 30mins = 1800 secs - divide that by 128 which gives 1 per 14secs approx increase of PWM value.