From: rob stone <floriparob@gmail.com>
To: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: Retrieve the server's time zone
Date: Wed, 22 Nov 2017 03:51:03 +1100
Message-ID: <1511283063.7643.3.camel@gmail.com> (raw)
In-Reply-To: <ov173b$u34$1@blaine.gmane.org>
References: <ov0j0b$nmt$1@blaine.gmane.org>
<CADK3HHJeLgaWisV=T29stN05uq7R6vXA5Xnngk8V7vBLGgd+gA@mail.gmail.com>
<B6F6FD62F2624C4C9916AC0175D56D88594B1541@jenmbs01.ad.intershop.net>
<CAB=Je-HSvuF0AhtUiTtnZ7DdCu0t--i+uj3r1x9KJWORU4yfxw@mail.gmail.com>
<ov173b$u34$1@blaine.gmane.org>
On Tue, 2017-11-21 at 13:44 +0100, Thomas Kellerer wrote:
> Vladimir Sitnikov schrieb am 21.11.2017 um 12:52:
> > Could you please clarify what is the case of "receiving server-side
> > time zone"?
> >
> > For instance: do you need PostgreSQL time zone or OS time zone?
>
> I need a timestamp in the server's time zone. Or at leas the time
> zone of
> the OS. The one that is configured for Postgres on the server would
> do as
> well (in my case that is the server's OS time zone)
>
> E.g.
>
> select localtimestamp
>
> will return the server's local time converted to the *client's* time
> zone in JDBC.
>
> In psql however, it does return the timestamp as "seen" by the
> server.
>
> I could live with getting the server's OS time zone through "show
> timezone"
> because then I could convert current_timestamp back to that time
> zone.
>
> Thomas
>
>
>
>
>
Hi Thomas,
What does java.util.TimeZone.getDefault() return on your server?
As in:- TimeZone timeZone = TimeZone.getDefault();
timeZone.getDisplayName();
timeZone.getID();
timeZone.getOffset( System.currentTimeMillis() );
HTH.
Rob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: floriparob@gmail.com, spam_eater@gmx.net
Subject: Re: Retrieve the server's time zone
In-Reply-To: <1511283063.7643.3.camel@gmail.com>
References: <ov0j0b$nmt$1@blaine.gmane.org> <CADK3HHJeLgaWisV=T29stN05uq7R6vXA5Xnngk8V7vBLGgd+gA@mail.gmail.com> <B6F6FD62F2624C4C9916AC0175D56D88594B1541@jenmbs01.ad.intershop.net> <CAB=Je-HSvuF0AhtUiTtnZ7DdCu0t--i+uj3r1x9KJWORU4yfxw@mail.gmail.com> <ov173b$u34$1@blaine.gmane.org> <1511283063.7643.3.camel@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox