Re: Re: First Saturday and Last Saturday of a month

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: Re: First Saturday and Last Saturday of a month
Дата
Msg-id
Pine.LNX.4.30.0108091818580.698-100000@peter.localdomain
Ответ на
Список
Дерево обсуждения
First Saturday and Last Saturday of a month "Brian C. Doyle" <bcdoyle@mindspring.com>
Alex Page writes:

> From: "Allan Engelhardt" 
> To: "Brian C. Doyle" ;
> 
> 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 по дате отправления
От: dado feigenblatt
Дата:
Сообщение: webware
От: Brian C. Doyle
Дата:
Сообщение: UpGrading to 7.1.2
FAQ