Re: fractional timezones

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: "Clark C (dot) Evans" <cce(at)clarkevans(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: fractional timezones
Date: 2002-07-08 15:51:34
Message-ID: 3D29B506.C467B464@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Hello. I don't seem to be able to set a fractional
> timezone for Katmandu, Nepal. In version 7.2.1, the
> following commands either fail or round to the
> nearest hour (GMT+6:00). I'm curious if I'm missing
> anything...
> SET TIME ZONE "GMT+5.75"
> SET TIME ZONE "GMT+5:45"
> SET TIME ZONE "Asia/Katmandu"
> SET TIMEZONE 5.45
> SET TIMEZONE 5.75
> SET TIMEZONE 345

You seem to be missing something in your time zone database:

thomas=# SET TIME ZONE "Asia/Katmandu";
thomas=# select timestamp with time zone 'now';
timestamptz
----------------------------------
2002-07-08 21:12:04.751675+05:45

thomas=# set datestyle='postgres';
thomas=# select timestamp with time zone 'now';
timestamptz
-------------------------------------
Mon Jul 08 21:30:17.138849 2002 NPT

But you've got other problems. Postgres has always had the time zone
info divided down to fit into a smaller slot in a lookup table. And it
divides by 10 to do it :(

So time zone intervals on 15 minute boundaries don't work. And NPT is
not in PostgreSQL's time zone lookup table, so it would have trouble
reading inputs with those set.

otoh, if all you need to do is work with local times, you won't need to
specify NPT explicitly, until you need to reload a database of course.

There is at least one other time zone on a 15m boundary, and afaik none
on a 10m boundary so one possibility is to recode our lookup table with
a new convention. But that hasn't happened yet.

You could modify src/backend/utils/adt/datetime.c to handle NPT as a
special case.

hth

- Thomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-07-08 15:57:31 Re: WAL recycling, ext3, Linux 2.4.18
Previous Message Thomas Lockhart 2002-07-08 15:42:35 Re: date problem and set style european