Re: Time bug with small years

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Time bug with small years
Date: 2011-11-24 13:48:39
Message-ID: CA+TgmoYwRrSjzGGZsigiDADnDO=+QuKdX27EEkBq2PgA4uw8RQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 23, 2011 at 11:45 PM, Rod Taylor <pg(at)rbt(dot)ca> wrote:
> sk_test=# select '1894-01-01'::timestamp with time zone;
>          timestamptz
> ------------------------------
>  1894-01-01 00:00:00-05:17:32
> (1 row)

I believe that -05:17:32 is the offset of your local time zone as
compared with UTC. For example:

rhaas=# select now();
now
------------------------------
2011-11-24 13:46:46.68016+00
(1 row)

rhaas=# set time zone 'Australia/Eucla';
SET
rhaas=# select now();
now
----------------------------------
2011-11-24 22:31:55.792565+08:45
(1 row)

rhaas=# set time zone 'UTC';
SET
rhaas=# select now();
now
-------------------------------
2011-11-24 13:46:58.480484+00
(1 row)

On my system, all current time zone offsets are multiples of 15
minutes, but historically that wasn't the case. It seems that in your
local time zone, the offset versus UTC was, as of January 1, 1894,
minus five hours, seventeen minutes, and 32 seconds.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Shulgin 2011-11-24 13:50:47 Re: Notes on implementing URI syntax for libpq
Previous Message Florian Pflug 2011-11-24 13:48:09 Re: Making TEXT NUL-transparent