Re: RES: Datetime problem - Mailing list pgsql-sql

From Alexander M. Pravking
Subject Re: RES: Datetime problem
Date
Msg-id 20040614171054.GB92544@dyatel.antar.bryansk.ru
Whole thread Raw
In response to RES: Datetime problem  ("Eric Lemes" <eric.lemes@zanthus.com.br>)
Responses Re: RES: Datetime problem
List 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


pgsql-sql by date:

Previous
From: "Jaime Casanova"
Date:
Subject: a query with = ALL
Next
From: Stephan Szabo
Date:
Subject: Re: query with =ALL