public inbox for [email protected]  
help / color / mirror / Atom feed
User time zone ignored in JDBC/PostgreSql
2+ messages / 2 participants
[nested] [flat]

* User time zone ignored in JDBC/PostgreSql
@ 2016-12-06 15:50 Clifton B. Sothoron Jr. <[email protected]>
  2016-12-07 13:45 ` Re: User time zone ignored in JDBC/PostgreSql Dave Cramer <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Clifton B. Sothoron Jr. @ 2016-12-06 15:50 UTC (permalink / raw)
  To: pgsql-interfaces

I've created a user with a time zone of America/Chicago and a server time zone of America/New York. I run the following query and America/New York is returned. The user time zone setting is ignored. It doesn't seem to be usable via JDBC.

select now(), extract(timezone FROM now()), current_setting('TIMEZONE'), now()-interval '1 hour' as "1HourAgo"

I don't see any documented PostgreSQL JDBC connection properties that cause the user time zone to be honored. Is there a way to via a JDBC connection to cause the user time zone to be used?

Thanks in advance,

Clifton Sothoron
Senior Programmer
Logi Analytics Inc.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: User time zone ignored in JDBC/PostgreSql
  2016-12-06 15:50 User time zone ignored in JDBC/PostgreSql Clifton B. Sothoron Jr. <[email protected]>
@ 2016-12-07 13:45 ` Dave Cramer <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Cramer @ 2016-12-07 13:45 UTC (permalink / raw)
  To: Clifton B. Sothoron Jr. <[email protected]>; +Cc: pgsql-interfaces

This is actually an artifact of the JDBC spec which at the moment eludes
me, but IIRC the time defaults to the time of the server running the
application; not the server.

AFAIK we don't even look at the user timezone.

Not sure that helps



Dave Cramer

[email protected]
www.postgresintl.com

On 6 December 2016 at 10:50, Clifton B. Sothoron Jr. <
[email protected]> wrote:

> I’ve created a user with a time zone of America/Chicago and a server time
> zone of America/New York. I run the following query and America/New York is
> returned. The user time zone setting is ignored. It doesn’t seem to be
> usable via JDBC.
>
>
>
> select now(), extract(timezone FROM now()), current_setting('TIMEZONE'),
> now()-interval '1 hour' as "1HourAgo"
>
>
>
> I don’t see any documented PostgreSQL JDBC connection properties that
> cause the user time zone to be honored. Is there a way to via a JDBC
> connection to cause the user time zone to be used?
>
>
>
> Thanks in advance,
>
>
>
> Clifton Sothoron
>
> Senior Programmer
>
> Logi Analytics Inc.
>
>
>


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-12-07 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-12-06 15:50 User time zone ignored in JDBC/PostgreSql Clifton B. Sothoron Jr. <[email protected]>
2016-12-07 13:45 ` Dave Cramer <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox