[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] timezone change



Hi,

Jo Even Skarstein wrote:
> 
> > Under MiNT you can do the same: Set your real time clock
> >(RTC) in UTC and
> 
> Exactly, this is what causes problems under anything else but MiNT...

That's not MiNT's problem. ;-)
But you can ...

> 
> > use only recent software that uses the new API.  Last
> > Sunday the output of
> 
> So using the old API you'll always get UTC?

If you don't use tzinit, and don't install the timezone database and
don't set $TZ, MiNT behaves exactly like GEMDOS.

> 
> > What are the alternatives? Switch back to local time
> > altogether? This
> 
> OK, what I'm going to suggest now is so incredibly simple that someone else must have had the idea but discarded it because it can't work...
> 
> 1. Set the RTC to local time, MagiC and TOS is now happy.
> 2. Since MiNT knows which timezone we're in, calculate the UTC from localtime, and use UTC in the kernel.
> 
> In theory, this would result in correct (local) time with both the new and old API, TOS and MagiC is happy, and the kernel use UTC. So why doesn't it work?
> 
> DST is a problem though, unless MiNT corrects the RTC itself.

That's exactly how MiNT is supposed to work in localtime mode.  But DST
changes should be handled by software but you don't want to fire up a 
daemon every single day of the year when it is only needed twice a
year.  And cron doesn't work reliably on exactly two days of the year,
those two days when we would need it.

The problem is that the kernel has to use an XBIOS function (Settime) to
change the RTC.  And somehow that XBIOS function doesn't work like it
should, it sometimes simply goes mad.  Another solution would be to
bypass the XBIOS and directly manipulate the RTC but that's less
portable.

I yelled for help with this when I implemented the new time model but
nobody ever offered any help.  I will look again when I'm finished with
the stuff I'm doing right now.

Ciao

Guido