Time zones and Star-Net
Posted in 1996
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Platform-Specific Issues
System setup: HP-UX A.09.01 on HP 9000/755
Informix Online, Star, ESQL, all ver 5.03.UC1
Informix-SQL ver 4.12.UE1
I have SQL which calls a stored procedure to query realtime weather
data, for later input into an ACE report. The data are queried based
on their observation times, which were encoded by the observers in the
data reports before they were transmitted long-line. External
programs decode these reports upon reception for insertion into the
Informix database.
The observation date/times are all in UTC time (6 hours later than
CST/5 hours later than CDT). All our external programs expect UTC
observation times. What I query depends on what the system UTC time
is. What I get when I query system time in the SPL is Central Time.
This was easy to fix, by "export TZ=UTC0UTC".
However...this only seems to work when the SQL is run on the server
containing the database. For instance, when doing:
dbaccess rfcdb getdata.sql
on the server, with the TZ variable redefined to UTC, the SPL uses UTC
time. But, if I do:
dbaccess rfcdb@wi getdata.sql
from a client, or even on the "wi" server, the SPL uses the local
(Central) time, ignoring the exported TZ variable.
Is there anyway to pass the TZ info to the server when using the
network? The above SQL is mostly a black-box process that runs on
cron, with users just looking at the finished results. But if someone
corrects bad data and wants to manually rerun the shell script, they
have to rlogin to the server and run it from there, which is kind of a
pain. I suppose I could work around this with a lot of programming,
but seems like I shouldn't have to.