I have developed a product which has a Dallas DS1302 RTC.
Given the application, it would be nice if one could automatically implement the daylight saving change.
A bit of googling digs out a lot of material including the whole lump of code from Linux, but it is quite big and I am running out of ROM space.
I am sure this must be an FAQ...
Is there some simple way of doing it?
Obviously one needs to have a user-configurable setting for the timezone; there are about 30 of those. Assuming one stores *local* time in the RTC (which in this case I can do) one just needs to store the start and end dates for the daylight saving period, and the time offset. If OTOH one is setting the RTC to GMT (as one would be if using e.g. a time server) then one needs to store the GMT-local offset as well.
All in all, there is a huge potential for subtle bugs in all this, and a lot of code which can never be tested properly.