On Tue, Aug 08, 2000 at 10:47:10PM -0700, Russ Allbery wrote:
> John Tobey <[EMAIL PROTECTED]> writes:
> > On Wed, Aug 09, 2000 at 02:22:22AM +0200, Bart Lateur wrote:
>
> >> date() would be more general, and replace both. You can pass it a time
> >> zone, ANY time zone, and it will tell you what time it is in that time
> >> zone.
>
> You're proposing embedding the full power of the Olson TZ library into
> Perl core. This is a nontrivial amount of data that changes four or five
> times a year. I really don't think this is a good idea. Furthermore, the
> only time zone database that can actually do this doesn't use the naming
> scheme that you're probably used to.
>
> > The JTobey::Date module uses the TZ environment variable (which, I'm
> > told, is non-portable), the esoteric POSIX routines tzset and tzname,
> > and some functions from the CPAN modules Date::Parse and Date::Format.
>
> It's far worse than non-portable; it's completely insufficient. The POSIX
> TZ syntax cannot represent many real time zones. You need the Olson-style
> naming scheme which refers to entries in a fairly large external database
You mean the "EST5EDT", "US/Pacific", "America/New_York", and suchlike
files in /usr/share/zoneinfo. Actually, I do use those indirectly,
though probably non-portably, by localizing C<$ENV{TZ}>. GNU Libc
takes care of finding the zoneinfo file, but lamentably reparses it
every time TZ changes and C<POSIX::tzset> is called.
My module does not parse old-style TZ formats, though some other
module (Date::Format or Time::Zone?) does.
-John