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

Re: [MiNT] timezone change



Hi,

Petr Stehlik wrote:
> 
> > > So what about moving the tzinit functionality into kernel and configure it
> > > from MINT.CNF? Then there would be no timestamps written because the
> > > MINT.CNF is (hopefully) evaluted first.
> >
> > This would make the kernel a lot bigger.  Have a look at the code in tz.c
> > in the MiNTLib.  You would have to enable the kernel to evaluate the
> > timezone database and that is a lot of stuff.
> 
> Pardon my ignorance, I don't have the kernel source handy. I thought
> something like 'UTC_OFFSET=-3600' in the MINT.CNF would be sufficient.
> Maybe that this could be limited to whole hours only so 'UTC_OFFSET=-1'
> would be perfect. So RTCs (both keyboard processor and NVRAM clock chip)
> plus TOS and MagiC would run in localtime while MiNT would run in UTC
> internally, thanks to that line in MINT.CNF. And I would just change this
> line twice a year (DST) to -2 (spring) and then back to -1 (autumn/fall).

As Qfunk has already mentioned the clock warp stuff would have to be
done relatively late, definitely after mint.cnf has been read (the
filesystems
are loaded then).  But then the potential gain is miniscule and you can
just as well call tzinit from within mint.cnf.

I prefer the tzinit solution because it allows you to do that any time
you want without booting.  Theoratically it should be possible to
automatically
change your system clock and then (also automatically) run tzinit when
you change your timezone.  In UTC mode that would be no problem, in
local
time mode you don't experience more problems than under TOS/Magic (if
you
set back your clock by one hour, make will also complain about
"modification
time in the future" under TOS/Magic).

> 
> If I am right then I can't see it hard to implement this. No timezone
> database needed, it would just set the initial offset for the MiNT GEMDOS
> internal clock.

But the solution outside of mint.cnf allows you to get along without
a reboot.

> 
> I have just reinvented the wheel most probably so don't kill me, please
> ;-)

I usually kill people that don't agree with me but I haven't found
your address yet. ;-)

Ciao

Guido