Re: Daylight saving time question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bayless Kirtley" <bkirt(at)cox(dot)net>
Cc: "John R Pierce" <pierce(at)hogranch(dot)com>, "PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Daylight saving time question
Date: 2009-05-18 17:26:29
Message-ID: 3656.1242667589@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Bayless Kirtley" <bkirt(at)cox(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-05-18 17:51:23 Re: Daylight saving time question
Previous Message Sam Mason 2009-05-18 17:19:55 Re: Need help