Timestamp with timezone output

Started by Arnaud Inovia Teamalmost 10 years ago5 messagesgeneral
Jump to latest
#1Arnaud Inovia Team
arnaud.becher@inovia-team.com

I have some question regarding some timezone behaviour.

Documentation is saying:

When a timestamp with time zone value is output, it is always converted

from UTC to the current timezone zone, and displayed as local time in that
zone. To see the time in another time zone, either change timezone or use
the AT TIME ZONE construct (see Section 9.9.3).

While using "psql", when selecting a column timestamp with timezone, I get
results with different timezones:

-[ RECORD 6 ]---+-----------------------
expiration_date | 2015-09-07 00:00:00+02
-[ RECORD 7 ]---+-----------------------
expiration_date | 2015-11-27 00:00:00+01

Shouldn't all value be converted to the same timezone ?

Thank you for your help !

*--*
*Arnaud Becher*
Paris - San Francisco
10 rue du Faubourg Poissonnière - 75010 Paris
T. + 33 (0)6 17 15 52 43
http://www.inovia.fr
<https://www.facebook.com/pages/Inovia-Team/147815591928404&gt;
<https://twitter.com/inoviateam&gt;
<https://www.linkedin.com/company/1099225?trk=tyah&amp;trkInfo=tarId%3A1414773408012%2Ctas%3Ainovia%2Cidx%3A2-3-6&gt;

Attachments:

0image/jpeg; name=0; x-mac-hide-extension=yesDownload
0image/jpeg; name=0; x-mac-hide-extension=yesDownload
0image/jpeg; name=0; x-mac-hide-extension=yesDownload
#2Larry Rosenman
ler@lerctr.org
In reply to: Arnaud Inovia Team (#1)
Re: Timestamp with timezone output

On 2016-05-25 09:47, Arnaud Inovia Team wrote:

I have some question regarding some timezone behaviour.

Documentation is saying:

When a timestamp with time zone value is output, it is always converted from UTC to the current timezone zone, and displayed as local time in that zone. To see the time in another time zone, either change timezone or use the AT TIME ZONE construct (see Section 9.9.3).

While using "psql", when selecting a column timestamp with timezone, I get results with different timezones:

-[ RECORD 6 ]---+-----------------------
expiration_date | 2015-09-07 00:00:00+02
-[ RECORD 7 ]---+-----------------------
expiration_date | 2015-11-27 00:00:00+01

Shouldn't all value be converted to the same timezone ?

Thank you for your help !

Daylight Savings Time?

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 E-Mail: ler@lerctr.org
US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281

#3Guillaume Lelarge
guillaume@lelarge.info
In reply to: Arnaud Inovia Team (#1)
Re: Timestamp with timezone output

Hi,

Le 25 mai 2016 4:50 PM, "Arnaud Inovia Team" <arnaud.becher@inovia-team.com>
a écrit :

I have some question regarding some timezone behaviour.

Documentation is saying:

When a timestamp with time zone value is output, it is always converted

from UTC to the current timezone zone, and displayed as local time in that
zone. To see the time in another time zone, either change timezone or use
the AT TIME ZONE construct (see Section 9.9.3).

While using "psql", when selecting a column timestamp with timezone, I

get results with different timezones:

-[ RECORD 6 ]---+-----------------------
expiration_date | 2015-09-07 00:00:00+02
-[ RECORD 7 ]---+-----------------------
expiration_date | 2015-11-27 00:00:00+01

Shouldn't all value be converted to the same timezone ?

Are you sure this column is a timestamp? Can you show us the table
definition?

#4Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Arnaud Inovia Team (#1)
Re: Timestamp with timezone output

On Wed, May 25, 2016 at 9:47 AM, Arnaud Inovia Team
<arnaud.becher@inovia-team.com> wrote:

While using "psql", when selecting a column timestamp with
timezone, I get results with different timezones:

-[ RECORD 6 ]---+-----------------------
expiration_date | 2015-09-07 00:00:00+02
-[ RECORD 7 ]---+-----------------------
expiration_date | 2015-11-27 00:00:00+01

Shouldn't all value be converted to the same timezone ?

Perhaps your local time zone ends Daylight Saving Time between
those dates, so the offset from UTC is different on those dates?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Arnaud Inovia Team
arnaud.becher@inovia-team.com
In reply to: Kevin Grittner (#4)
Re: Timestamp with timezone output

Ok, it seems the Daylight Savings Time is perfect explanation to me. Thanks
y'all, you're the best !

*--*
*Arnaud Becher*
Paris - San Francisco
10 rue du Faubourg Poissonnière - 75010 Paris
T. + 33 (0)6 17 15 52 43
http://www.inovia.fr
<https://www.facebook.com/pages/Inovia-Team/147815591928404&gt;
<https://twitter.com/inoviateam&gt;
<https://www.linkedin.com/company/1099225?trk=tyah&amp;trkInfo=tarId%3A1414773408012%2Ctas%3Ainovia%2Cidx%3A2-3-6&gt;

On Wed, May 25, 2016 at 5:01 PM, Kevin Grittner <kgrittn@gmail.com> wrote:

Show quoted text

On Wed, May 25, 2016 at 9:47 AM, Arnaud Inovia Team
<arnaud.becher@inovia-team.com> wrote:

While using "psql", when selecting a column timestamp with
timezone, I get results with different timezones:

-[ RECORD 6 ]---+-----------------------
expiration_date | 2015-09-07 00:00:00+02
-[ RECORD 7 ]---+-----------------------
expiration_date | 2015-11-27 00:00:00+01

Shouldn't all value be converted to the same timezone ?

Perhaps your local time zone ends Daylight Saving Time between
those dates, so the offset from UTC is different on those dates?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachments:

0image/jpeg; name=0; x-mac-hide-extension=yesDownload
0image/jpeg; name=0; x-mac-hide-extension=yesDownload
0image/jpeg; name=0; x-mac-hide-extension=yesDownload