in reply to setting TZ causes Date::Manip to report incorrect time

You need to say TZ=PST8PDT. PDT by itself is not the name of a timezone.

Replies are listed 'Best First'.
Re: Re: setting TZ causes Date::Manip to report incorrect time
by meonkeys (Chaplain) on Sep 09, 2003 at 03:35 UTC

    Uggggh. According to the POD from Date::Manip, PDT and PST are both valid values for TZ! Plus, there's no mention of 'PST8PDT', something I never would've guessed to try. :(

    The following timezone names are currently understood (and can be used in parsing dates). These are zones defined in RFC 822. Universal: GMT, UT US zones : EST, EDT, CST, CDT, MST, MDT, PST, PDT Military : A to Z (except J) Other : +HHMM or -HHMM ISO 8601 : +HH:MM, +HH, -HH:MM, -HH

    How did you know that it needs to be PST8PDT for the Pacific time zone? Could you point me to some manpages, books, or hyperlinks?

    The only box-specific timezone information I can find on my machine is ZONE="America/Los_Angeles" in /etc/sysconfig/clock, but I don't know if this is Redhat-specific. Could you point me to another file where the default timezone is garnered if TZ isn't set?

    I did find a page which gives some specific examples on what to set TZ to. Anyone who finds more info, please share!

    Update:
    Found this mention of PST8PDT in the docs:

    The timezone may be in the STD#DST format (in which case both abbreviations must be in the table above) or any of the formats described above.
    However, this also implies that 'PDT' is a valid value for the TZ environment variable, but it doesn't seem to work correctly (see original question).

    ---
    "A Jedi uses the Force for knowledge and defense, never for attack."
      Try /etc/TIMEZONE.