Re: TZ info used by dB drivers
- From: jonathan.leffler@xxxxxxxxx (Jonathan Leffler)
- Date: Mon, 9 Jul 2007 06:37:35 -0700
On 7/8/07, d_roesler@xxxxxxxxxxx <d_roesler@xxxxxxxxxxx> wrote:
I'm trying to track down how TZ info is used by a dB driver, in this case
DBD::Ingres.
It would appear that TZ is getting passed to the driver on the first
connection (when the driver is installed) and doesn't see changes to
$ENV{TZ} between the first connection and subsequent connections in the
running script.
If this is a driver issue is there an "uninstall driver" method, such that
subsequent connections will reload the driver in the running script so the
changed $ENV{TZ} will be seen? If this is a DBI issue is there a way for
the changed $ENV{TZ} value to be seen in the driver?
There are multiple places that could be affected by this - I just spent the
weekend chasing timezones around a JDBC driver, and it is painful.
The underlying Unix API really only provides one function call to control
the current time zone, and call is tzset(). No arguments, no return value.
It gets called implicitly by a bunch of functions, too, if they think it
necessary. The result is 'gating'; the time zone is set once and not
adjustable thereafter -- which is what you are observing.
Speculation: maybe, just maybe, if you set the environment and manage to
explicitly call tzset() afterwards, it might, conceivable notice the new
time zone. But I'm not confident that it would, and could easily be
platform specific.
The java.util.Date, java.util.Calendar and java.util.TimeZone APIs allow for
a lot of control and information for which there is no corresponding C API,
sadly.
--
Jonathan Leffler <jonathan.leffler@xxxxxxxxx> #include <disclaimer.h>
Guardian of DBD::Informix - v2007.0226 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
- Follow-Ups:
- RE: TZ info used by dB drivers
- From: D Roesler
- RE: TZ info used by dB drivers
- References:
- TZ info used by dB drivers
- From: D Roesler
- TZ info used by dB drivers
- Prev by Date: Re: DBI-Help
- Next by Date: RE: TZ info used by dB drivers
- Previous by thread: TZ info used by dB drivers
- Next by thread: RE: TZ info used by dB drivers
- Index(es):
Relevant Pages
|