[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mozilla-os2
Subject:    Re: Time (was: Re: os2thred.c vs. ntthread.c questions)
From:       "David Mooney" <mooney () ca ! ibm ! com>
Date:       1998-05-13 14:42:26
[Download RAW message or body]

John Fairhurst wrote:
> It seems to me that VACPP doesn't look at the value of TZ unless
> explicitly told to; it uses its default of EST5EDT.
> Can anyone else confirm this?

I can confirm that VAC++ does not check your TZ variable unless you explicitly
call _tzset().

Getting timezones to work on OS/2 is a major pain, as you've probably
realised.  The OS itself has no real concept of timezone, so any support that
you have in your application will have to come from the C runtime.  When you
call ftime(), the runtime calls DosGetDateTime to get the correct local time,
and then uses the information in TZ to calculate the GMT offset.  It uses all
this info to calculate the number of seconds from the epoch.  Ideally,
DosGetDateTime() would return the correct timezone information, but it doesn't
so ftime() has to figure it out itself, which makes it doubly important to
have TZ set properly and to call _tzset() as part of your program's
initialisation.

Moving to daylight savings time is even worse, but I'll spare you the details.

dave
--
    David Mooney     |      VisualAge C++ Service and Support
  mooney@ca.ibm.com  |  "I'm cold, and there are wolves after me."

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic