pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander M. Pravking <fduch@antar.bryansk.ru>
To: Eric Lemes <eric.lemes@zanthus.com.br>
Cc: pgsql-sql@postgresql.org
Subject: Re: RES: Datetime problem
Date: Mon, 14 Jun 2004 21:10:54 +0400
Message-ID: <20040614171054.GB92544@dyatel.antar.bryansk.ru> (raw)
In-Reply-To: <AIEBKHHFIIDLBADEGCPDCEKLCAAA.eric.lemes@zanthus.com.br>
References: <164.1087224965@sss.pgh.pa.us>
	<AIEBKHHFIIDLBADEGCPDCEKLCAAA.eric.lemes@zanthus.com.br>

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



view thread (4+ messages)  latest in thread

Message-ID: <20040614171054.GB92544@dyatel.antar.bryansk.ru>
Permalink:  ../20040614171054.GB92544@dyatel.antar.bryansk.ru/
Also on:    postgresql.org/message-id/20040614171054.GB92544@dyatel.antar.bryansk.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: fduch@antar.bryansk.ru, eric.lemes@zanthus.com.br
  Subject: Re: Datetime problem
  In-Reply-To: <20040614171054.GB92544@dyatel.antar.bryansk.ru>
  References: <164.1087224965@sss.pgh.pa.us> <AIEBKHHFIIDLBADEGCPDCEKLCAAA.eric.lemes@zanthus.com.br> <20040614171054.GB92544@dyatel.antar.bryansk.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox