Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: IDT timezone


  • From: Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
  • To: pgsql-general(at)postgresql(dot)org
  • Subject: Re: IDT timezone
  • Date: Sat, 22 Apr 2006 09:06:38 -0000
  • Message-id: <slrne4jsgu(dot)tl6(dot)andrew+nonews(at)trinity(dot)supernews(dot)net>

On 2006-04-21, "Brandon Metcalf" <bmetcalf(at)nortel(dot)com> wrote:
> What is the best way to handle timestamps with a timezone of IDT?  I
> see that I could modify src/backend/utils/adt/datetime.c to support
> IDT, but what is the best solution?
>
> Basically, I have an application where I'm grabbing the timezone from
> the output of date(1) and appending that to a timestamp before I do an
> INSERT.  In the situations where the timezone is IDT, the INSERT
> fails.

On reasonably up-to-date systems, why not use the %z format specifier for
date(1) to get a numeric zone offset?

Better yet, omit the offset entirely and make sure that the session timezone
is correctly set (to, presumably, 'Asia/Jerusalem') and let postgres figure
out whether DST is in effect (which it can do just as well as date(1) can,
provided you're keeping reasonably up to date - pg 8.0 onwards carry their
own copy of the standard zoneinfo database with them).

Zone names like 'IST' are in any event entirely ambiguous and should never
be used - you could regard it as a pure fluke that pg happens to resolve
'IST' as +0200 rather than +0530...

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group