Note that Guenther is not on the time zone mailing list. --ado ---------- From: Guenther Grau[SMTP:Guenther.Grau@bk.bosch.de] Sent: Tuesday, April 07, 1998 12:36 PM To: tz@elsie.nci.nih.gov Subject: Question of time :-) Hi, I don't know if this is correct address to send this to, but I hope you'll be able to redirect me in case it's not :-) In my application I need to know, the time difference between any given time in any given timezone, and UTC. Is this possible to do WITHOUT changing the TZ environment variable? I cannot do this, because this is in a multithreaded program, and changing TZ would affect other threads. I cannot fork another process, as this takes too much time and resources. I need a program, that does sth. like this:
echo $TZ MET date Tue Apr 7 18:31:42 MET DST 1998 calculateUtcDifference "1.2.1998 12:13 EST" 5 hours
I would be great if you knew a portable solution (solaris/hp-ux). Thanx in advance Guenther
From: Guenther Grau[SMTP:Guenther.Grau@bk.bosch.de] Sent: Tuesday, April 07, 1998 12:36 PM In my application I need to know, the time difference between any given time in any given timezone, and UTC. Is this possible to do WITHOUT changing the TZ environment variable? Not without some hacking. You could take the public domain tz code <ftp://elsie.nci.nih.gov/pub/>, or the GNU C library code <ftp://ftp.gnu.org/pub/gnu/glibc-2.0.6.tar.gz>, and make a truly reentrant version of the localtime function, so that you can pass the time zone rule as a separate argument to your modified version of localtime. If you do this, please send your improvements to the original authors; you're not the first to have asked about this but nobody has implemented it yet as far as I know.
participants (2)
-
Olson, Arthur David -
Paul Eggert