Re: Re: First Saturday and Last Saturday of a month - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: Re: First Saturday and Last Saturday of a month
Date
Msg-id Pine.LNX.4.30.0108091818580.698-100000@peter.localdomain
Whole thread Raw
In response to Re: Re: First Saturday and Last Saturday of a month  ("Alex Page" <alex.page@solid-state-logic.com>)
List pgsql-general
Alex Page writes:

> From: "Allan Engelhardt" <allane@cybaea.com>
> To: "Brian C. Doyle" <bcdoyle@mindspring.com>;
> <pgsql-general@postgresql.org>
> Sent: Wednesday, August 08, 2001 11:18 PM
> Subject: [GENERAL] Re: First Saturday and Last Saturday of a month
>
>
> > You *do* know the algorithm for testing if year yyyy is a leap year, don't
> you?
>
> > ((yyyy%4) && !(yyyy%400))
>
> ITYM ((yyyy%4) && ( !(yyyy%400) || (yyyy%1000) ) - year 2000 was a leap
> year, even though it was a multiple of 400, because it was a millenium.

Actually it's

y % 4 = 0 and (y % 100 <> 0 or y % 400 = 0)

(SQL pedants would use mod(y,4) etc. instead.)

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


pgsql-general by date:

Previous
From: "dado feigenblatt"
Date:
Subject: webware
Next
From: "Brian C. Doyle"
Date:
Subject: UpGrading to 7.1.2