Re: timezone() with timeofday() converts the wrongdirection? - Mailing list pgsql-general

From Bruce Momjian
Subject Re: timezone() with timeofday() converts the wrongdirection?
Date
Msg-id 200504212352.j3LNqA214545@candle.pha.pa.us
Whole thread Raw
In response to Re: timezone() with timeofday() converts the wrongdirection?  ("Steve - DND" <postgres@digitalnothing.com>)
List pgsql-general
Steve - DND wrote:
> >
> > What version of PostgreSQL are you running? I seem to remember a few
> > versions ago the offset having the wrong sign.
>
> I'm running 8.0.2 Win32.

BSD Unix looks strange too:

    test=> select current_timestamp;
              timestamptz
    -------------------------------
     2005-04-21 19:45:55.553635-04
    (1 row)

    test=> SELECT timezone('UTC', current_timestamp::timestamp);
               timezone
    -------------------------------
     2005-04-21 15:46:12.740201-04
    (1 row)

    test=> SELECT timezone('UTC', current_timestamp::timestamp)::timestamp
    without time zone;
              timezone
    ----------------------------
     2005-04-21 15:46:14.333257
    (1 row)

But these look fine:

    test=> SELECT timezone('UTC', current_timestamp);
             timezone
    ---------------------------
     2005-04-21 23:48:18.60604
    (1 row)

    test=> SELECT current_timestamp::timestamp;
             timestamp
    ----------------------------
     2005-04-21 19:51:25.867765
    (1 row)

    test=> SELECT current_timestamp::timestamp with time zone;
              timestamptz
    -------------------------------
     2005-04-21 19:51:30.178186-04
    (1 row)

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: "Mark Miller"
Date:
Subject: Install development headers/libraries Win32 v 8.0.2
Next
From: Carlos Correia
Date:
Subject: Record as a parameter to a function