Re: Getting number of days in a month - Mailing list pgsql-general

From Patrick Welche
Subject Re: Getting number of days in a month
Date
Msg-id 20000413102617.B11677@quartz.newn.cam.ac.uk
Whole thread Raw
In response to Re: Getting number of days in a month  (Guillaume Perréal <perreal@lyon.cemagref.fr>)
Responses Re: Getting number of days in a month
List pgsql-general
On Thu, Apr 13, 2000 at 09:24:36AM +0200, Guillaume Perréal wrote:
>
> Thanks, I rewrote my function to solve my problem.
>
> In fact, the problem is that ('2000-10-01'::datetime + '1 month'::interval)
> gives '2000-10-31' instead of '2000-11-01'.
> I think it's a bug, isn't it?

It's our old friend daylight savings changeover:

rfb=# select ('2000-10-01'::datetime + '1 month'::interval);
        ?column?
------------------------
 2000-10-31 23:00:00+00
(1 row)
            ^^

1 hour less because going from summer -> winter (For me BST->GMT)

Cheers,

Patrick

pgsql-general by date:

Previous
From: "omid omoomi"
Date:
Subject: Re: PHP-Postgres link
Next
From: Michael Sobolev
Date:
Subject: Character encodings...