[tz] Adapting localtime.c
random832 at fastmail.com
Sat Oct 8 20:00:47 UTC 2016
On Sat, Oct 8, 2016, at 15:46, Carsten Larsen wrote:
> The actual time is is number of seconds since 1.1.1978 and possibly a
> GMT offset (if the user have bothered to set it. The system does not
> take it into consideration). There is no concept of daylight saving
> rules and no concept of UTC.
So does AmigaOS not ship with a standard C library with its own time.h
functions? Even if they only handle one system-defined timezone, seeing
which of localtime/gmtime gives 1978-01-01 00:00:00 when you pass in a
value of 0 would be useful.
> I guess I need to determine the exact point of January 1, 1970,
> 00:00:00 *UTC* on my (AmigaOS) timeline in order to use the time.h
> functions in tz, and I assume the TZ variable and tz code can help me
> to do so. Right ?
You need to figure out how the system's native functions handle it.
Also http://distributed.amiga.org/misc/timezone.text may be useful.
Maybe look at what this "ixemul" thing does. The version at
appears to treat it as UTC - from gettimeofday.c:
__time_req->tr_node.io_Command = TR_GETSYSTIME;
omask = syscall (SYS_sigsetmask, ~0);
DoIO((struct IORequest *)__time_req);
syscall (SYS_sigsetmask, omask);
*tp = __time_req->tr_time;
/* add the offset from unix to amigados time system */
tp->tv_sec += (8*365+2) * 24 * 3600;
More information about the tz