project QadFinancials > class BVATPeriod > method GetDate

function returns date

Description

Returns date adapted to new year.


Parameters


itDateinputdateThe date to adapt.
iiOldYearinputintegerThe year you're copying
iiNewYearinputintegerThe year you're creating


Internal usage


QadFinancials
method BVATPeriod.DataNewMultipleCopyYear


program code (program1/bvatperiod.p)

if day (itDate)   = 29 and
   month (itDate) = 2
then assign viYear = year (itDate) + iiNewYear - iiOldYear
            viDay  = if viYear modulo 4    = 0 and
                        viYear modulo 100 <> 0 or
                        viYear modulo 400  = 0
                     then 29
                     else 28
            vtDate = date (month (itDate),
                           viDay,
                           viYear).
else assign vtDate = date (month (itDate),
                           day (itDate),
                           year (itDate) + iiNewYear - iiOldYear).

return vtDate.