Reputation: 670
I'm trying to understand how PostgreSQL handles TIMESTAMP WITH TIMEZONE type, and I 'm running into the discrepancy between theory and practice.
According to the documentation and other stack overflow posts,
For timestamp with time zone, the internally stored value is always in UTC ... When a timestamp with time zone value is output, it is always converted from UTC to the current timezone zone.
I believe this means that all timestamps in any given SELECT statement will be in the same/current timezone. However, this is what I see:
interview_timestamp is TIMESTAMP WITH TIMEZONE. This blows my mind.
Upvotes: 0
Views: 614
Reputation: 670
Just for the record, this was really a client thing and it because an offset from UTC depends on the time of year (EDT: -4, EST: -5). Offset "-05:44:38" is correct too, this is offset in TZ database for EDT/EST for years prior to 1883.
Upvotes: 0
Reputation: 246163
It is strange that you sometimes see a time zone offset and sometimes not, I would blame that on the GUI you are using. Try with psql
and see how the data look there.
The offset “-05:44:38” is perfectly normal, since time zones were introduced in the late 19th century and local solar time is used before that.
Upvotes: 1