Re: RES: Datetime problem
От | Alexander M. Pravking |
---|---|
Тема | Re: RES: Datetime problem |
Дата | |
Msg-id | 20040614171054.GB92544@dyatel.antar.bryansk.ru обсуждение исходный текст |
Ответ на | RES: Datetime problem ("Eric Lemes" <eric.lemes@zanthus.com.br>) |
Ответы |
Re: RES: Datetime problem
|
Список | 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 по дате отправления: