Date: Wed, 14 Apr 93 17:44:04 EDT From: ronis AT onsager DOT chem DOT mcgill DOT ca (David Ronis) To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: TZ environment variable and time functions Hi, I've written a program that uses several of the time functions. My problem is that I need to compile things both with djgpp as well as a real mode C compiler (MSC). As far as I can tell, djgpp is smart enough to figure out when daylight savings time goes into effect with the simple TZ=EST5 environment variable setting; MSC is not, and requires something like TZ=EST5DST, which has strange effects under djgpp. Now my question. While I could temporarily change the environment variable within a batch file, I though that it would be simpler to simply change the environment variable to the shorter one (EST5) using setenv() or putenv() in the djgpp program. To be sure, when I do this subsequent calls to getenv() return the sortened variable. However, tzset() and the time routines (which are only called afterwards) seem to ignore the new setting. Is this because, djgpp pops back to real mode, with a different copy of the environment table, when the time calls are made? If so, any suggestions as to how to fix this bug? Thanks in advance. David Ronis