Re: Getting number of days in a month

From: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
To: Guillaume Perréal <perreal(at)lyon(dot)cemagref(dot)fr>
Cc: Ken Causey <ken(at)premiernet(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Getting number of days in a month
Date: 2000-04-13 09:26:17
Message-ID: 20000413102617.B11677@quartz.newn.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Sobolev 2000-04-13 09:59:51 Character encodings...
Previous Message Guillaume Perréal 2000-04-13 07:24:36 Re: Getting number of days in a month