Table of Contents
ixtimezone - allows Unix timezone-handling to be used with ixemul.library
ixtimezone option
Ixtimezone uses the TZ environment variable to determine the
offset in seconds between Universal Coordinated Time (aka Greenwich Mean
Time) and the local timezone. This offset is stored in a field in the ixemul
library base. The offset is also written to the environment variable IXGMTOFFSET.
The ixemul.library is now able to correctly determine the local time and
GMT.
The TZ environment variable should contain the name of one of the files
in the /etc/zoneinfo directory. For example, I live in the Netherlands,
so my TZ is set to Europe/Amsterdam. The TZ environment variable must be
set before using ixtimezone, otherwise ixtimezone wouldn’t know what the
local timezone is, and therefore it wouldn’t be able to compute the offset
from GMT.
You should put ixtimezone in your startup-sequence to ensure that
it is called every time you start your computer. After ixtimezone has been
executed, you can set TZ to whatever value you want. For example, to see
what time it is in Japan, set TZ to Japan and type ixtimezone -test. But
don’t use any other option, as the other options set the GMT offset based
on the current TZ value, which is Japan!
Note that you need to call this
tool at least twice a year, when Daylight Saving Time comes in effect and
when it ends.
- -test
- Print the local time and GMT (according to ixemul.library)
to standard output. Use this to test the current settings. It doesn’t affect
anything else.
- -get-offset
- Calculate the difference between local time and
GMT in seconds. The resulting offset is stored in the library base of ixemul.library
and is also written to the global environment variable IXGMTOFFSET.
If
the IXGMTOFFSET environment variable didn’t exist or the offset stored in
the original environment variable differed from the new offset (which happens
when Daylight Saving Time starts or ends), then a copy of IXGMTOFFSET is
written to the ENVARC: directory.
Since ixemul.library reads the IXGMTOFFSET
environment variable just after it is loaded into memory, it is sufficient
to use ixtimezone only when Daylight Saving Time starts or ends. Provided,
of course, that the contents of the ENVARC: directory is copied to ENV:
before ixemul.library is loaded.
- -check-dst
- This option does the same as -get-offset,
but it also detects if Daylight Saving Time has started or ended. If so,
it automatically sets the Amiga clock to the correct time. So you no longer
need to change the time manually twice a year.
- -patch-resource
- This option
does the same as -get-offset, but it also patches the battclock.resource. This
is most useful if you also run the Unix operating system on your Amiga
(NetBSD or Linux, for example). Unix requires that the clock is set to Greenwich
Mean Time, while the Amiga requires that the clock is set to local time.
By patching the battclock.resource one can set the Amiga clock, which is
managed by the battclock.resource, to GMT time. The patch ensures that whenever
the Amiga wants to obtain the time, the GMT time is converted into local
time. There is also no longer any need to change the Amiga clock when Daylight
Saving Time starts or ends, since the battery clock is set to GMT.
ixtimezone
detects if you try to patch the battclock.resource a second time. It won’t
patch the resource again, but it will check if the current GMT offset is
still the same as when the patch was originally installed. If it has changed,
the battclock.resource offset will also be changed.
- -remove-patch
- Removes the
battclock.resource patch. It checks if the patch was really installed before
removing it. This option doesn’t do anything else.
/etc/zoneinfo standard
directory used for created files
The original idea for the -patch-resource
option came from the unixclock utility written by Geert Uytterhoeven. unixclock
is available on Aminet.
The time functions, the timezone databases
and the zic(8)
utility for compiling the timezone files in the /etc/zoneinfo
directory are available from elsie.nci.nih.gov in the /pub directory.
Hans
Verkuil (hans@wyst.hobby.nl)
Table of Contents