Problems with timestamp with time zone and old dates? - Mailing list pgsql-general

From Michael Clark
Subject Problems with timestamp with time zone and old dates?
Date
Msg-id CACAT_AdOT50a4HvidEzFTGNE_i6U4Wj=2i+jT6qtD8W2N0vwGg@mail.gmail.com
Whole thread Raw
Responses Re: Problems with timestamp with time zone and old dates?  (Steve Crawford <scrawford@pinpointresearch.com>)
Re: Problems with timestamp with time zone and old dates?  (Scott Marlowe <scott.marlowe@gmail.com>)
Re: Problems with timestamp with time zone and old dates?  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-general
Hello all,

I have a weird situation I am trying to work through, and could use some help if anyone can provide some.

I have a table with a column to store timestamp with time zone, and when I store an older take (before 1895 or so), the value I get back from PG when doing a select seems odd and is causing my client some issues with the format string.

For example, if I insert like so:
INSERT INTO sometable (startdate) values ('1750-08-21 21:17:00+00:00');

I get the following when I select:
SELECT startdate FROM sometable;
          startdate           
------------------------------
 1750-08-21 15:59:28-05:17:32
(1 row)


It's the odd offset that is causing my client problems, and I was wondering if this is expected?
(I am using PG9.1.3)

This contrasts:
INSERT INTO sometable (startdate) values ('2012-08-21 21:17:00+00:00');

I get the following when I select:
       startdate        
------------------------
 2012-08-21 17:17:00-04
(1 row)


Can anyone shed some light on if this is expected, or if I am doing something odd?

Much appreciated!
Michael

pgsql-general by date:

Previous
From: Darren Duncan
Date:
Subject: Re: redundant fields in table for "performance optimizations"
Next
From: Steve Crawford
Date:
Subject: Re: Problems with timestamp with time zone and old dates?