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

Re: [MiNT] where to fetch local time



On Wed, Dec 13, 2000 at 06:03:07PM +0200, Martin-Éric Racine wrote:
> On Sat, 25 Nov 2000, Guido Flohr wrote:
> 
> > Tgettimeofday (MiNT) always returns the time in UTC (as
> > seconds since the epoch). 
> 
> I just noticed that the library function settimeofday (MINTLIB
> seems to build it as a wrapper to Tsettimeofday) ends up altering
> localtime, instead of UTC.
> 
> For instance, every time K9 receives an NTP packet (NTP runs in
> UTC), it changes localtime to match UTC, instead of adjusting
> the kernel's UTC reference and leaving localtime alone.

I consider the current tzinit approach a failed experiment.  Setting date
and time always causes problems.  That's why I supposed a different
approach, either the Linux way or the (Free)BSD way.  The task of writing
back the system time into the hardware should be accomplished by some sort
of device driver in cooperation with a user space program.

If nobody volunteers to make the current approach bomb-proof the interface
will slightly change in the future.  Such a change shouldn't be a big
problem, maybe a matter of replacing the call to tzinit by a call to some
other tool in mint.cnf.  The interface for Tgettime, Tgetdate,
Tgettimeofday and their TSet counterparts will of course not
change.  There will be no need to recompile any programs.

Ciao

Guido