in reply to Re: What Time is It?
in thread What Time is It?

So, who is responsible for the POSIX system call that doesn't understand 'MST' as being unique? And BTW, thanks for the clarification.

--hsm

"Never try to teach a pig to sing...it wastes your time and it annoys the pig."

Replies are listed 'Best First'.
Re: Re: Re: What Time is It?
by ysth (Canon) on Jan 05, 2004 at 04:11 UTC
    MST isn't unique; it could also mean Moscow Summer Time (according to the Olson files, this was used in 1917 only).

    I'm not sure what your question is. I'm guessing that ActiveState's perl is using C library functions provided by Microsoft that interpret TZ as specified by the POSIX standard. If you have TZ=MST, it seems to default to a 0 offset, saying you are in a timezone named MST with offset 0. (When you say TZ=UTC+7, you are saying you are in a timezone named UTC with offset 7 hours. :)

    Many unix-like systems have recognized the limitations of these POSIX-style timezone settings and switched to looking up the TZ environment variable in a database maintained by Arthur David Olson, thus allowing you to look up a timezone like MST (actually just a link to America/Phoenix; the Olson database names are usually in form (continent or ocean)/(major city) ). I wouldn't expect Microsoft to do so anytime soon.

      If the posix standard adopt the Olsen model, then it probably would find it's way into the MS posix compatility layer (eventually).

      In the meantime, using a posix complient TZ setting, or not setting TZ at all, will allow perl/localtime to produce the correct time, assuming that the underlying OS clock is correctly set.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      Hooray!