О Таймзоне в OS/2

От: <cgpro_at_mx_ru>
Дата: Fri 11 Apr 2003 - 09:38:05 MSD


Касательно того, что DosGetDataTime() возвращает неправильную таймзону.

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   <EMAIL: PROTECTED> | "I`m cold, and there are wolves after me."

С уважением,
 Александр Власов Получено Fri Apr 11 05:38:03 2003

Этот архив был сгенерирован hypermail 2.1.8 : Fri 24 Apr 2015 - 16:12:34 MSK