Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VbAB7-0002u3-Cc for pgsql-admin@arkaria.postgresql.org; Tue, 29 Oct 2013 14:21:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VbAB6-0006XL-E6 for pgsql-admin@arkaria.postgresql.org; Tue, 29 Oct 2013 14:21:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VbAB3-0006RH-AS for pgsql-admin@postgresql.org; Tue, 29 Oct 2013 14:21:49 +0000 Received: from asbnvacz-mailrelay01.megapath.net ([207.145.128.243]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VbAAu-000300-M8 for pgsql-admin@postgresql.org; Tue, 29 Oct 2013 14:21:47 +0000 Received: from mail1.sea5.speakeasy.net (mail1.sea5.speakeasy.net [69.17.117.39]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 367B31EE4FBB for ; Tue, 29 Oct 2013 10:21:07 -0400 (EDT) Received: (qmail 5940 invoked from network); 29 Oct 2013 14:21:06 -0000 Received: by simscan 1.4.0 ppid: 5416, pid: 27590, t: 0.4187s scanners: clamav: m: Received: from 97-124-246-26.hlrn.qwest.net (HELO [192.168.2.16]) (sribe@elevated-dev.com@[97.124.246.26]) (envelope-sender ) by mail1.sea5.speakeasy.net (qmail-ldap-1.03) with AES128-SHA encrypted SMTP for ; 29 Oct 2013 14:21:06 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Subject: Re: displaying UTC time in local time From: Scott Ribe In-Reply-To: <1383055558685-5776257.post@n5.nabble.com> Date: Tue, 29 Oct 2013 08:21:02 -0600 Cc: pgsql-admin@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <4A6122E3-1BA1-4948-A3A2-D7358CD41E1C@elevated-dev.com> References: <1382997116262-5776169.post@n5.nabble.com> <13452.1383001151@sss.pgh.pa.us> <1383055558685-5776257.post@n5.nabble.com> To: mark_postgres_user X-Mailer: Apple Mail (2.1816) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail1.sea5 X-Spam-Level: X-Spam-Status: No, score=0.0 required=8.0 tests=none autolearn=disabled version=3.0.4 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On Oct 29, 2013, at 8:05 AM, mark_postgres_user = wrote: > So, because my timestamps are defined as timestamp without > timezone data type and are stored in UTC... No, they're not stored as *any* time zone at all, not even UTC. They are ti= mestamp *without* time zone. > I can use AT TIME ZONE to convert > the displayed time to any timezone including my local timezone. No, you can use AT TIME ZONE to convert them to a timestamp with time zone = and simultaneously specify the time zone they are relative to, in other wor= ds the time zone to which they were adjusted before being stored. > P.S. Someone else owns the database I'm using so I can't change the > timestamps to be timestamp with timezone. OK, you're stuck with an incorrect data type. That's why it's not intuitive= to work with. Because it's timestamp without time zone, you have to do the= work that PG would do for you if the correct type were used--you have to m= ake sure the timestamps are all adjusted to the same time zone before being= stored, and you have to convert them to local time after retrieval. --=20 Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin