function returns date
Description
Returns date adapted to new year.
Parameters
itDate | input | date | The date to adapt. |
iiOldYear | input | integer | The year you're copying |
iiNewYear | input | integer | The year you're creating |
Internal usage
QadFinancials
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.