Re: Daylight saving time question - Mailing list pgsql-general

From Tom Lane
Subject Re: Daylight saving time question
Date
Msg-id 3656.1242667589@sss.pgh.pa.us
Whole thread Raw
In response to Re: Daylight saving time question  ("Bayless Kirtley" <bkirt@cox.net>)
List pgsql-general
"Bayless Kirtley" <bkirt@cox.net> writes:
> For some reason I can't seem to make it work. I have tried setting the
> timezone
> in postgresql.conf as "timezone = 'America/Chicago'" and "timezone =
> 'CST6CDT'"
> both of which still returned one hour behind. I also tried both of your
> suggestions
> as SQL statements right after establishing a database connection and still
> get the
> same wrong time.

> I have a Java application on Windows XP PRO and the way I am getting the
> time is "Select CURRENT_TIME". Is there something I am missing or is there
> another way I should be getting the time?

Are you sure the system's time is actually set correctly on the server
machine?  Seems like confusion between standard and daylight time in
setting the server's clock might be the underlying issue here.

Another theory is that the database is perfectly fine but there's
something wacko happening on the Java side.  Have you tried running
"select current_time" from some other application, like psql?  (In
that connection I note that "select current_time" only gives time of
day not a full timestamp, so I'd not exactly be surprised if it does
confuse Java.  "select current_timestamp" produces a much less ambiguous
result.)

            regards, tom lane

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Need help
Next
From: Scott Marlowe
Date:
Subject: Re: Daylight saving time question