Re: 'NOW' in UTC with no timezone

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Jaromir Dolecek <jdolecek(at)NetBSD(dot)org>
Cc: Stuart Bishop <stuart(at)stuartbishop(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: 'NOW' in UTC with no timezone
Date: 2004-10-15 09:43:35
Message-ID: 20041015094333.GC14405@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2004-10-15 09:57:08 Re: Tsearch2 trigger firing...
Previous Message Net Virtual Mailing Lists 2004-10-15 09:39:24 Tsearch2 trigger firing...