[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] timezone change
Anthony Jacques wrote:
> I really dont see any problem with keeping the RTC in localtime and
> converting to UTC for internal use.
There is one: Daylight saving time. MiNT would have to correct the RTC in this case, which is not as simple as it may look. Apart from the XBIOS-problem Guido mentioned, you can also run into all sorts of problems which may force the user to correct the RTC itself anyway.
If you use UTC in the RTC you avoid all this, but then you'll have to live with incorrect time under TOS and MagiC...
However, I think this can be solved with some additional software under TOS/MagiC:
TOS has one or two RTCs, depending on hardware. IIRC all TOS-versions has a RTC which is usually in the keyboard-processor (I don't know how it works on the Milan or Hades). This is - IIRC - the one used by TOS for all time-functions. It doesn't have a battery, so TOS must refresh it from the battery-clock (if available) at each cold-boot.
What if you simply wrote a small program that you placed in the autofolder (or made it an accessory or CPX) which read the time from the RTC, made any corrections necessary depending on timezone and DST and then updated TOS' RTC? Then you could run the battery-clock in RTC all the time, and you'll avoid all problems with DST etc. under TOS and MagiC as well as MiNT.
Such a tool should be a part of the FreeMiNT-project to make sure it's always up to date re. DST. It shouldn't be too hard since you can use code that already exists.
Jo Even Skarstein