Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 8F6149F9398 for ; Tue, 5 Dec 2006 16:29:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 76015-02 for ; Tue, 5 Dec 2006 16:29:20 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0102.google.com (nz-out-0506.google.com [64.233.162.235]) by postgresql.org (Postfix) with ESMTP id 567D69F938C for ; Tue, 5 Dec 2006 16:29:28 -0400 (AST) Received: by nz-out-0102.google.com with SMTP id i11so2114851nzh for ; Tue, 05 Dec 2006 12:29:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=hqQwNm1HVT0Jgv1Ip7YWjn6MrFrCf7T87kH6L7GvNoK/m+/7jSbilbXgTNU3E20Ak7zb1hhy/McwwJqGMmiXJ2shXNkgjNbzqyzz3TZbj+lslZKfWzRjwllslGKDKraTcdt0b0LVz+WzsFQkENnZvMzU9eBHNPv3+w4z2xRV7OU= Received: by 10.78.201.10 with SMTP id y10mr9424862huf.1165350566328; Tue, 05 Dec 2006 12:29:26 -0800 (PST) Received: by 10.78.152.4 with HTTP; Tue, 5 Dec 2006 12:29:26 -0800 (PST) Message-ID: Date: Tue, 5 Dec 2006 12:29:26 -0800 From: "Collin Peters" To: pgsql-sql@postgresql.org Subject: Question about "AT TIME ZONE" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=BAYES_50, SPF_PASS X-Spam-Level: X-Archive-Number: 200612/55 X-Sequence-Number: 27011 The following is taken from section 9.9.3 of the help docs =========================================== Examples (supposing that the local time zone is PST8PDT): SELECT TIMESTAMP '2001-02-16 20:38:40' AT TIME ZONE 'MST'; Result: 2001-02-16 19:38:40-08 SELECT TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-05' AT TIME ZONE 'MST'; Result: 2001-02-16 18:38:40 The first example takes a time stamp without time zone and interprets it as MST time (UTC-7), which is then converted to PST (UTC-8) for display. The second example takes a time stamp specified in EST (UTC-5) and converts it to local time in MST (UTC-7). =========================================== In the first example it says it is converted to PST "for display". In the second example it is not converted to PST for display. Does this mean that if a timestamp *with* a timezone is specified, and it also includes "AT TIME ZONE", that it is not converted to PST "for display" at the end? I just want to make sure that these two examples perform completely different tasks. Essentially the first item: SELECT TIMESTAMP '2001-02-16 20:38:40' AT TIME ZONE 'MST'; And this: SELECT TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-07' AT TIME ZONE 'PST'; are the exact same thing. Kind of confusing. Regards, Collin