Re: BUG in date_part

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Alexandru COSTIN" <acostin(at)NOSPAMrds(dot)ro>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG in date_part
Date: 2000-10-10 03:03:49
Message-ID: 17312.971147029@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Alexandru COSTIN" <acostin(at)NOSPAMrds(dot)ro> writes:
> I've discovered a bug in the date_part function. It returns 25 when
> doing select date_part('day','2000-03-26'::date);

Is 2000-03-26 a daylight savings changeover day where you live?
If so, this is a known bug that's fixed for 7.1. date_part is not
the problem, it's being handed a wrong timestamp input value ---
there's a DST boundary bug in the date-to-timestamp converter.
In my timezone 2000-04-02 was a changeover day, and 7.0.2 gives:

select '2000-04-02'::date::timestamp;
?column?
------------------------
2000-04-01 23:00:00-05
(1 row)

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2000-10-10 03:44:59 Re: TCL, but not TK
Previous Message Stephan Szabo 2000-10-10 02:56:12 Re: Possible bug with permissions. (Table A has select , insert, update rights but has a reference to a second table that only has select rights)