pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Collin Peters <cadiolis@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Question about "AT TIME ZONE"
Date: Tue, 5 Dec 2006 12:29:26 -0800
Message-ID: <df01c91b0612051229n21d98f49pd353779a6316b800@mail.gmail.com> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <df01c91b0612051229n21d98f49pd353779a6316b800@mail.gmail.com>
Permalink:  ../df01c91b0612051229n21d98f49pd353779a6316b800@mail.gmail.com/
Also on:    postgresql.org/message-id/df01c91b0612051229n21d98f49pd353779a6316b800@mail.gmail.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: cadiolis@gmail.com
  Subject: Re: Question about "AT TIME ZONE"
  In-Reply-To: <df01c91b0612051229n21d98f49pd353779a6316b800@mail.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