Re: BUG #16027: Invalid output of to_timestamp - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16027: Invalid output of to_timestamp
Date
Msg-id 13930.1569512357@sss.pgh.pa.us
Whole thread Raw
In response to BUG #16027: Invalid output of to_timestamp  (PG Bug reporting form <noreply@postgresql.org>)
Responses RE: BUG #16027: Invalid output of to_timestamp
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> With a date in year 1904 or earlier, the to_timestamp function outputs
> unexpected characters:

> template1=# select to_timestamp('19041231','YYYYMMDD');
>          to_timestamp
> ------------------------------
>  1904-12-31 00:00:00-05:32:11

> Expected is "1904-12-31 00:00:00-06"

There's nothing particularly unexpected about that.
I surmise that you're using the America/Detroit zone,
because nothing else matches that UTC offset, and what
the IANA timezone database has for Detroit is

# Zone    NAME        STDOFF    RULES    FORMAT    [UNTIL]
Zone America/Detroit    -5:32:11 -    LMT    1905
            -6:00    -    CST    1915 May 15  2:00

with some commentary explaining why they think Detroit adopted
standard time in 1905 rather than some other year.  Before
standardized time, most places observed local solar time, so
tzdb provides an estimate of what the UTC offset would have
been for that in Detroit.

If this discombobulates you, you can edit your local copy of
the tzdb files; but it's not wrong from our standpoint.

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16027: Invalid output of to_timestamp
Next
From: Jeffrey Sturm
Date:
Subject: RE: BUG #16027: Invalid output of to_timestamp