Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Calculation of Leap Year

Re: Calculation of Leap Year

From: ats <damorgan_at_x.washington.edu>
Date: Sun, 10 Oct 2004 20:47:26 -0700
Message-ID: <1097466398.968477@yasure>


Satish wrote:

> Hi ALl,
>
> IS there any way in PL/SQL to identify an year as a Leap Year?
>
> Thanks,
> Satish

CREATE OR REPLACE FUNCTION is_leap_year (yearstr VARCHAR2) RETURN BOOLEAN IS d DATE;

BEGIN
   d := TO_DATE('29-FEB-' || yearstr);
   RETURN TRUE;
EXCEPTION
   WHEN OTHERS THEN
     RETURN FALSE;
END;
/

Daniel Morgan Received on Sun Oct 10 2004 - 22:47:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US