Re: RES: Datetime problem

From: "Alexander M(dot) Pravking" <fduch(at)antar(dot)bryansk(dot)ru>
To: Eric Lemes <eric(dot)lemes(at)zanthus(dot)com(dot)br>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: RES: Datetime problem
Date: 2004-06-14 17:10:54
Message-ID: 20040614171054.GB92544@dyatel.antar.bryansk.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Jun 14, 2004 at 01:20:14PM -0300, Eric Lemes wrote:
> Hello,
>
> - PostgreSQL 7.3.2 on i386-redhat-linux GCC 3.2.2
> - Timezone: Brazil (GMT-3, I think).

What's about daylight saving time for you?
I'm almost sure the DST boundary is near the date in your example.

However, with 7.3.4 on FreeBSD I get:
fduch=# SHOW TimeZone ;
TimeZone
---------------
Europe/Moscow
(1 row)

fduch=# SELECT to_timestamp('2004 10 31 00 00 00', 'YYYY MM DD HH MI SS');
to_timestamp
------------------------
2004-10-31 00:00:00+04
(1 row)

fduch=# SELECT to_timestamp('2004 11 01 00 00 00', 'YYYY MM DD HH MI SS');
to_timestamp
------------------------
2004-11-01 00:00:00+03
(1 row)

So both timestamps before and after boundary are parsed well for me.

> I think my problem is with the time zone. Using a SET TIME ZONE GMT, the
> result is Ok. But I don't know how to work with time zones correctly.
>
> When I send a date to to_timestamp, pgsql thinks this date is in GMT?

Hmm, 7.3 and 7.4 docs say that it returns timestamp (WITHOUT time zone
is default since 7.3 IIRC), but in fact it accepts and returns timestamp
WITH time zone. This is probably a documentation bug...

--
Fduch M. Pravking

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2004-06-14 17:38:04 Re: query with =ALL
Previous Message Jaime Casanova 2004-06-14 17:06:05 a query with = ALL