TZ=GMT+1 for date command is NOT working? - Unix

This is a discussion on TZ=GMT+1 for date command is NOT working? - Unix ; Currently I am sitting here in the Timezone GMT+1 (Frankfurt/Germany). I am logged in on a computer which is in Timezone PDT When I enter now: date then the remote computer gives me: Sat May 24 02:01:18 PDT 2008 When ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: TZ=GMT+1 for date command is NOT working?

  1. TZ=GMT+1 for date command is NOT working?

    Currently I am sitting here in the Timezone GMT+1 (Frankfurt/Germany).
    I am logged in on a computer which is in Timezone PDT

    When I enter now:

    date

    then the remote computer gives me:
    Sat May 24 02:01:18 PDT 2008

    When I enter then:

    TZ=GMT+1 date

    then the computer returns:

    Sat May 24 08:01:36 GMT 2008

    First error: The Timestamp return should from my view return "GMT+1" and not only "GMT".
    Second error: The time is wrong. It should return either at least

    Sat May 24 10:01:36 GMT 2008

    or even better:

    Sat May 24 11:01:36 GMT+1 2008

    So even I subtract the possibly not considered daylight saving hour lag the time is wrong.

    What's the error?

    Peter

  2. Re: TZ=GMT+1 for date command is NOT working?

    Begin <4837daf4$0$7534$9b4e6d93@newsspool1.arcor-online.net>
    On 24 May 2008 09:08:04 GMT, Peter Ohoven wrote:
    > Currently I am sitting here in the Timezone GMT+1 (Frankfurt/Germany).


    If you're in Frankfurt, you'll be in CET/MEZ TZ, which is currently
    actually CEST (CET+daylight savings) and as such GMT+2.

    On my (FreeBSD) system, sh -c 'TZ=CET date' gives the expected result:

    Wed May 28 07:05:34 CEST 2008

    Whether using GMT+/-N notation does useful things I won't comment on,
    but I will say that using ``unsupported'' values for TZ= can silently
    cause interesting results.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

  3. Re: TZ=GMT+1 for date command is NOT working?

    jpd wrote:
    > Begin <4837daf4$0$7534$9b4e6d93@newsspool1.arcor-online.net>
    > On 24 May 2008 09:08:04 GMT, Peter Ohoven wrote:
    >> Currently I am sitting here in the Timezone GMT+1
    >> (Frankfurt/Germany).

    >
    > If you're in Frankfurt, you'll be in CET/MEZ TZ, which is currently
    > actually CEST (CET+daylight savings) and as such GMT+2.

    GMT-2, not GMT+2, even if it is 2 hours later than GMT.
    Or better:
    CEST-2
    Both setiing result in the correct time being displayed, but the earlier in
    a wrong timezone to be shown.

    the -2 is the offset to GMT/UTC, so it indicates by how many hours GMT/UTC
    is off, which is indeed 2 hours for CEST

    Bye, Jojo



  4. Re: TZ=GMT+1 for date command is NOT working?

    2008-05-28, 05:11(+00), jpd:
    > Begin <4837daf4$0$7534$9b4e6d93@newsspool1.arcor-online.net>
    > On 24 May 2008 09:08:04 GMT, Peter Ohoven wrote:
    >> Currently I am sitting here in the Timezone GMT+1 (Frankfurt/Germany).

    >
    > If you're in Frankfurt, you'll be in CET/MEZ TZ, which is currently
    > actually CEST (CET+daylight savings) and as such GMT+2.
    >
    > On my (FreeBSD) system, sh -c 'TZ=CET date' gives the expected result:
    >
    > Wed May 28 07:05:34 CEST 2008
    >
    > Whether using GMT+/-N notation does useful things I won't comment on,
    > but I will say that using ``unsupported'' values for TZ= can silently
    > cause interesting results.

    [...]

    BTW, I don't know if it has be mentionned already, but the
    GMT+xxx is obtained by date +GMT%z, not date +%Z

    Note that in some locales on some systems the default date
    output has the GMT offset rather than the timezone name.

    ~$ date
    Wed May 28 09:43:15 BST 2008
    ~$ LC_TIME=fr_FR date
    mercredi 28 mai 2008, 09:43:21 (UTC+0100)

    ~$ locale date_fmt
    %a %b %e %H:%M:%S %Z %Y
    ~$ LC_TIME=fr_FR locale date_fmt
    %A %-e %B %Y, %H:%M:%S (UTC%z)

    (that's with GNU libc).

    BST is British Summer time which is one hour east of GMT
    defined as BST-1

    Mnemonic: == GMT
    So BST == GMT + 1
    gives BST - 1 == TZ

    --
    Stéphane

+ Reply to Thread