Re: Postgres and timezones - Mailing list pgsql-general

From Steve Crawford
Subject Re: Postgres and timezones
Date
Msg-id CAEfWYyyrxBDaO4=6VNk5QU=UQH9=WDH29UygwBEsGUveu_JqkA@mail.gmail.com
Whole thread Raw
In response to Re: Postgres and timezones  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
Right, I was just mentioning the existence of that built-in data in case it was of use to the OP. But I should have also mentioned some caveats in case it is important to his use-case:

1. Full names are not as standardized as one might like so there are multiple possible full names for a time zone, i.e. "America/Los_Angeles", "posix/America/Los_Angeles", "posix/US/Pacific", "PST8PDT", ...

2. Unlike full names, abbreviations do *not* distinctly identify a single time zone. CST is the short name for US Central Standard Time, Cuba, ROC and PRC among others.

3. pg_timezone_names is a *view* and the results for abbreviation and offset change depending on time of year. Right now it's winter on the US West Coast so the abbreviation for "posix/US/Pacific" is PST and I will get results searching for abbreviations matching "PST" but none for "PDT". Come spring, that will change.

Cheers,
Steve


On Wed, Jan 20, 2016 at 7:46 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:


2016-01-20 16:38 GMT+01:00 Steve Crawford <scrawford@pinpointresearch.com>:
Is this of any use?

select * from pg_timezone_names where name = 'Europe/Lisbon';
    name      | abbrev | utc_offset | is_dst
---------------+--------+------------+--------
Europe/Lisbon | WET    | 00:00:00   | f


This is list of know timezones. So if you are searching "abbrev" then you can find it there.


Pavel

 
-Steve

On Wed, Jan 20, 2016 at 7:24 AM, Steve Rogerson <steve.pg@yewtc.demon.co.uk> wrote:
On 20/01/16 13:27, Pavel Stehule wrote:
>
>
>
> Postgres doesn't store original TZ. It does recalculation to local TZ. If you
> need original TZ, you have to store it separetely.
>

I know and that's what I'm trying to deal with. Given I know the origin TZ  -
as in Europe/Lisbon I'm trying to determine the short name so I can store it.

I guess I'll have to use something other than pg to do it.

Steve




--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



pgsql-general by date:

Previous
From: Sachin Srivastava
Date:
Subject: Re: Syntax error for Function
Next
From: Steve Rogerson
Date:
Subject: Re: Postgres and timezones