All pastes #342933 Raw Edit

Something

public text v1 · immutable
·published 2007-02-06 17:36 UTC
rendered paste body
   function Next_Date(Date : in Date_Type) return Date_Type Is

      NextDate : Date_Type;

      Month_Array : array (1..12) of Integer :=
        (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

   begin

      NextDate := Date;

      if Date.Day = Month_Array(Date.Month) then

         if Date.Month = 12 then
            NextDate.Year := Date.Year + 1;
            NextDate.Month := 1;
            NextDate.Day := 1;
         else
            NextDate.Month := Date.Month + 1;
            NextDate.Day := 1;
         end if;

      else

         NextDate.Day := Date.Day + 1;

      end if;

      return NextDate;

   end Next_Date;