Re: date bug (again) - Mailing list pgsql-bugs

From Philip Warner
Subject Re: date bug (again)
Date
Msg-id 3.0.5.32.20000815155239.02814210@mail.rhyme.com.au
Whole thread Raw
In response to date bug (again)  (Darcy Buskermolen <darcy@ok-connect.com>)
List pgsql-bugs
At 22:38 14/08/00 -0700, Darcy Buskermolen wrote:
>let me try this again...
>
>
>Here is an other set of strange bugs I've discovered relating to dates.
>
>SELECT date_part('day', ('2000-11-1 0:00'::datetime + '-1day'))::int4 AS
>days_in_month;
>
>  31
>
>
>SELECT date_part('day', (('2000-10-1 0:00'::datetime + '1 month') + '-1
>day'))::int4 AS days_in_month;
>
>  30
>
>SELECT date_part('day', date_trunc('month', ('2000-10-1 0:00'::datetime +
>'1 month')) + '-1 day')::int4 AS days_in_month;
>
>  30
>(1 row)

FWIW, with 7.0.2 under Linux, I get 31 in each case.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

pgsql-bugs by date:

Previous
From: "Andrei N.Sobchuck"
Date:
Subject: Re: Segmentation fault.
Next
From: Darcy Buskermolen
Date:
Subject: Re: date bug (again)