Re: Time bug with small years

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Rod Taylor <pg(at)rbt(dot)ca>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Time bug with small years
Date: 2011-11-24 17:00:54
Message-ID: 24689.1322154054@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> 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)

> 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.

And in fact, a quick grep through the timezone database shows that
you must be using America/Toronto:

# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Toronto -5:17:32 - LMT 1895
-5:00 Canada E%sT 1919
-5:00 Toronto E%sT 1942 Feb 9 2:00s
-5:00 Canada E%sT 1946
-5:00 Toronto E%sT 1974
-5:00 Canada E%sT

The general practice in the Olson database is to show localities as
using local mean time until the year in which they adopted some form of
standardized time. So local midnight of 1894-01-01 is in fact at an
unusual (for us) offset from UTC.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2011-11-24 17:30:03 proposal: use errcontext for custom exception too
Previous Message Tom Lane 2011-11-24 16:47:31 Re: Wire protocol: type-specific opt-in to binary format