Re: 'NOW' in UTC with no timezone - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: 'NOW' in UTC with no timezone
Date
Msg-id 20041015094333.GC14405@svana.org
Whole thread Raw
In response to Re: 'NOW' in UTC with no timezone  (jdolecek@NetBSD.org (Jaromir Dolecek))
List pgsql-general
On Fri, Oct 15, 2004 at 06:48:40AM +0200, Jaromir Dolecek wrote:
> Stuart Bishop wrote:
> > Indeed - I was under the impression that the timezone would be preserved
> > (which is the case in the external datetime libraries I use), but I now
> > see that PostgreSQL will lose this information.
>
> Err - how come, lose?

It doesn't remember what timezone to gave when you entered the data. It
converts it to a date/time and displays it in your local timezone.

In other words, postgresql, treats the following as identical:

# select '2004-09-01 12:0:0 CEST'::timestamptz;
      timestamptz
------------------------
 2004-09-01 12:00:00+02
(1 row)

# select '2004-09-01 20:0:0 AEST'::timestamptz;
      timestamptz
------------------------
 2004-09-01 12:00:00+02
(1 row)

The answer is correct, but you're getting less out than you put in..

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: "Net Virtual Mailing Lists"
Date:
Subject: Tsearch2 trigger firing...
Next
From: Oleg Bartunov
Date:
Subject: Re: Tsearch2 trigger firing...