From: John Cowan <xxxxxx@ccil.org>
Date: Monday, August 12, 2019 11:20 AM

On Mon, Aug 12, 2019 at 11:08 AM <xxxxxx@ancell-ent.com> wrote:

[...]
 
It'll stay flushed, but it sounds like for the date-time SRFI you'd like SRFI-170 to provide a pointer to the timezone files, which I suppose is practical if you seriously narrow the requirements to a few major Linux distribution families, the BSDs, and ... Apple doesn't like Java at all, what does it do for timezones? 

It seems to vary between releases, but /var/db/zoneinfo and /usr/share/zoneinfo have both been used.  The former is also used by BSD.

But in who's remit are we going to make it to supply the file?  I'd sure like to make it the date-time SRFI's, people who care about this are more likely to know, using tools such as we provide in SRFI-170s, the latter should care about kernels, but not so much about distributions.

[....]

How do we also find out what timezone we're in??

That's precisely what the TZ variable is for....

The difficulties arise when there is no TZ variable....

If a user cares about the time zone they're in, why not make them set TZ to a correct value?  On the other hand, neither of Bionic Beaver or OpenBSD 6.5 set it.

The following does not fill me with joy:

The file /etc/timezone can be any of the timezone name (Linux),

Present in Bionic Beaver, containing "America/Chicago".

a symlink to the timezone data file (OpenBSD),

There's a /etc/localtime in OpenBSD 6.5 that's symlinked to /usr/share/zoneinfo/America/Chicago, so if we make it the remit of the date-time SRFI, SRFI-170 must implement read-symlink, or we must demand an Advanced File Operations SRFI.

or (ugh) a *copy* of the timezone data file (FreeBSD).  In the third case the name is irretrievable.

In which case we'd have to fall back to a TZ environment variable?  FreeBSD drops "what is your timezone for programming purposes" on the floor??

On Cygwin the fallback is to the Windows timezone setting, which maps only imperfectly to IANA time zone names.  On Mac OS you run a program called `systemsetup`, but unfortunately the location of this program changed between releases.

Bleah, and systemsetup is not in PATH?

The ironic thing is that Posix tzset() knows the answer already but will not disclose it!  It only sets the timezone, daylight, and tzname files, and throws away everything else.

Hard to imagine POSIX dropped "what is your timezone for programming purposes" on the floor.

- Harold