Re: Leap Years
От | A. Kretschmer |
---|---|
Тема | Re: Leap Years |
Дата | |
Msg-id | 20100225172043.GA1354@a-kretschmer.de обсуждение исходный текст |
Ответ на | Leap Years (Atif Jung <atifjung@gmail.com>) |
Ответы |
Re: Leap Years
|
Список | pgsql-novice |
In response to Atif Jung : > INFORMIX uses the rleapyear(year) ESQLC function to determine if a year is a > leap year or not. Does POSTGRES have an equivalent? > > Thanks to all. > > Atif You can create such a function: create or replace function rleapyear(in year int) returns bool as $$begin if extract( month from ($1::text || '-02-28')::date + '1day'::interval) = 2 then return true; else return false; end if; end; $$language plpgsql; (I don't know how exactly this function works in INFORMIX, my function is just a guess) Regards, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99
В списке pgsql-novice по дате отправления: