Re: more timeofday() and "set time zone" weirdness

From: <jason_priebe(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: more timeofday() and "set time zone" weirdness
Date: 2003-08-14 12:51:50
Message-ID: 20030814125150.34746.qmail@web40413.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


--- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> jason_priebe(at)yahoo(dot)com (Jason Priebe) writes:
> > foo=> select cast(timeofday() as timestamp with
> time zone); set time
> > zone 'GMT+4'; select cast(timeofday() as timestamp
> with time zone);
>
> This breaks because localtime() is broken: it
> returns the string "GMT"
> as the time zone. You can see the problem without
> any reference to
> Postgres:
>
> $ date
> Wed Aug 13 16:09:56 EDT 2003
> $ TZ='GMT+4' date
> Wed Aug 13 16:09:57 GMT 2003
> $
>
> My advice: don't specify the time zone like that.
> Use 'EST5EDT' or some
> other standard timezone specifier. Or avoid
> timeofday() ... now() or
> current_timestamp would be better choices anyway ...

Agreed. My problem was that under Cygwin, I was
not able to use any timezone specifications other than
the GMT+X notation. However, I did find a fix for
this problem: I tarred up my /usr/share/zoneinfo
files from RH Linux 7.3, and plopped them down into
the Cygwin filesystem, and voila, I was able to use
the "nice" timezone notations, like
"America/New_York".

Specifically, I had to do this:

SET TIME ZONE '/usr/share/zoneinfo/America/New_York'

For some reason, I had to use the entire path to
the file, rather than just 'America/New_York' like
I would do under Linux. Maybe this little tidbit will
help another poor Windows user. Believe me, if I
could
use Linux for this application, I would.

Thanks for taking the time to respond to my barrage
of questions yesterday.

-Jason Priebe

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-08-14 13:27:12 Re: Support contracts (was Re: Commercial support?)
Previous Message jason_priebe 2003-08-14 12:46:52 Re: SET TIME ZONE with GMT+X notation