[BusyBox] Query about the date function

Manuel Novoa III mjn3 at codepoet.org
Fri Jul 11 17:24:01 UTC 2003


On Fri, Jul 11, 2003 at 12:33:15AM -0400, tom at ceisystems.com wrote:
> 	I may be way off here, but I think what is happening is the
> confusion of how a normal distro such as Debian or Gentoo handles
> timezones, and how uClibc is handling them.

Yes... in spite of the fact that there is an entry in the uClibc FAQ
covering this.

> Most distros use the
> "zoneinfo" files, which contain some sort of binary data (executable or
> not, I do not know).

The zoneinfo files that glibc uses are derived from David Olson's
tzcode and tzdata packages ( ftp://elsie.nci.nih.gov/pub/ ).  They
are not executable.  Do 'man tzfile' for more details on their
contents.

You may also want to run 'du' on the /usr/share/zoneinfo tree to
see why I don't have much motivation to support its use in uClibc.
Even a gzip -9'd tar file of that data is over 260K on my system.

> However, uClibc appears (correct me if I am wrong
> here, Erik, because I have _not_ looked at the code involved) to simply
> read the /etc/TZ file or the TZ env. variable.

When I wrote the uClibc time code, my goal was SUSv3 compliance.
Hence, the uClibc time code lacks some of the features of the
glibc time code (leapsecond support for example).  It also used
the TZ environment variable exclusively for timezone information.
But this was more than sufficient for most situations where uClibc
would be used.

Eventually though, I gave in to the requests to provide a way to set
the timezone globably.  What I chose to do was allow a file named
/etc/TZ to contain the timezone setting in the same format as the
TZ environment variable, so that the amount of additional library
code would be minimal.

Now I can certainly understand the desire to be able to specify a
timezone based on a continent/country/region.  But in my mind, this
is more of a system administration issue than a uClibc issue.
I hoped that someone putting together a uClibc-based distribution
might eventually contribute a single _small_ file (compared to the
very hefty zoneinfo directory tree) mapping such specifiers to TZ
settings in standard format, and possibly a small utility to allow
a user to set either their TZ environment variable or /etc/TZ.

> This file should simply
> contain the time zone code (EST), the offset (5), and the Daylight
> Savings Time name, if there is one (EDT).  This makes the eastern time
> zone "EST5EDT".

For the accepted format for TZ, see

http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html

Manuel



More information about the busybox mailing list