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

Re: Time patch -- let's talk about it.



On Mon, 23 Jun 1997, Yves Pelletier wrote:

> I agree that nothing should break if the environment variable or
> the cookie are absent.  What is the default behaviour in that
> case?  IMHO, if there is insufficient information from the
> cookie and env. var., then the system should assume the internal
> clock is set to local time, and give out information in local
> time as well. 

On Sat, 19 Apr 1997, Jerry Geiger wrote:

> Last year I posted here a diff archive for POSIX time (esp. TZ rules) in
> mintlib, to patch libsrc PL46.
> 
> Further I made some proposals for a gettimeofday funtion and TOS
> compatible time handling in MiNT, but no one seemed interested.
> So my MiNT system is running with UTC time now, therefore I also patched the
> time() function from mintlib (replacing the mktime() call with the _unixtim()
> function from MiNT sources).
> Of course this works only on machines running the clock with UTC time. And
> of course you have to recompile all programs using local time (date, ls,
> mailers, etc).
> To make it portable at least I suggest a clock cookie:
> 'CLOC' 'clock_cookie_value' where the upper 8 bits in clock_cookie_value
> are a bitfield:
> if = 0 or doesn't exist: clock is (Tgettime/date returns) local time + DST
> according TZ environment variable
> 	00000001	clock is UTC time
> 	00000010	Tgettimeofday() function and unixtime variable
> 			available, returns (only) timeval struct
> 	00000110	Tgettimeofday() function returns also timezone

or if someone needs it:
 	00000000	clock is local time incl. DST
 	00000001	clock is local time, DST has to be performed by lib
 	00000010	clock is UTC time
 	00010000	Tgettimeofday() function and unixtime variable
 			available, returns (only) timeval struct
 	00110000	Tgettimeofday() function returns also timezone


btw:
The lib would work if the TZ variable is not set, but of a lot of programs
won't. The default TZ value - if TZ is unset - the library uses
has to be 'LMT' (local mean time) and not GMT or UTC!


  jerry
        jerry@merlin.abacus.de          jerry@zedat.fu-berlin.de