Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHBlP-0000fV-KM for pgsql-jdbc@arkaria.postgresql.org; Tue, 21 Nov 2017 16:51:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHBlP-0005Mu-5E for pgsql-jdbc@arkaria.postgresql.org; Tue, 21 Nov 2017 16:51:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eHBlO-0005Mg-TK for pgsql-jdbc@lists.postgresql.org; Tue, 21 Nov 2017 16:51:11 +0000 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eHBlM-0005iW-M2 for pgsql-jdbc@postgresql.org; Tue, 21 Nov 2017 16:51:09 +0000 Received: by mail-qt0-x243.google.com with SMTP id r58so20089035qtc.0 for ; Tue, 21 Nov 2017 08:51:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:mime-version :content-transfer-encoding; bh=2Jkt35mmxNGEw34b46tv0r1y+jUEGQzgb85zd9Q6thg=; b=PieIexHilzQf/mj/nVTqjF0mD9F/a7b9N67u07dsUcA/zpQLoBW0PMm5JtOh0Ukmv+ x2O8dAU5yL5mW1oePufAhEmDu+p0Rf7XxNG3wJ7yqUkV04anhyn6kdZRRNX9Rgfr3Eer RE3YJHAyxqx+PwExQsP+SgtNq1lf+nVQpbDh9i0cvKa9ue+jBIwGp944DMeWprqdbQJN W3NISAQBX+g0tDTh2dxOm7NRzI7POgNxrr3xqCqDUFfEGFS0Q7fe7i04+jr69MHTw9Fn YpRBUFiSUMzebhdqo/kg/O7DB7QlbYft6d8DLGBaNm5h2lvM7+DJHaMBi38pwWtS51EB FvPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=2Jkt35mmxNGEw34b46tv0r1y+jUEGQzgb85zd9Q6thg=; b=BHyPoKq7SYX9nj6IH+JHD6DFxxGBD9KGbCGX6ADUZzGnZk2Z07NEfqKkyeS97bA0U6 Sut2+XL0cStSuO6jpl63E2fAI78WJB1ayjCJfeaQdBOoj4edzVQu4J8gFMQH0yy2gT9i vl5OcTfm8LM+sg0uN85GKb7oaNwZSkpnPsVaKKv20bZ2EiXfuXQU/gf/Bdh1R1jxVpHN UoIuz6LQQa3RsJNLlFcBk4BZ2639wWasuMpxYjqoIGGg4uYINnAYxv92ahUzJyuyJHZD kG1cx7wtp04MTaP+kvsV1Q+J7ZdevtHRx01K6d+2x7DpuBtKxdQgg8athrXLtXjhh5uE 5YVA== X-Gm-Message-State: AJaThX7qo6X5T3ulw0eiV1iudE1sA/mqIdwuxxffovRGlBK6DtoN/E4d jljnobPKJ2R1cD5rDe4M/G4= X-Google-Smtp-Source: AGs4zMZ/9FCVWoehxzpYxGcacyQIqJqOv/1Se/i03lfzLKN1c5IGbLDhQWVXOHmL36U654eAipZITQ== X-Received: by 10.200.3.23 with SMTP id q23mr29995451qtg.229.1511283067433; Tue, 21 Nov 2017 08:51:07 -0800 (PST) Received: from roblaptop ([2804:14d:baa0:8491:461e:a1ff:fe19:c7bd]) by smtp.gmail.com with ESMTPSA id i31sm513543qtb.34.2017.11.21.08.51.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Nov 2017 08:51:07 -0800 (PST) Message-ID: <1511283063.7643.3.camel@gmail.com> Subject: Re: Retrieve the server's time zone From: rob stone To: Thomas Kellerer , pgsql-jdbc@postgresql.org Date: Wed, 22 Nov 2017 03:51:03 +1100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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