Pra evitar conflito, tem o prefixo ze_, porque o nome é muito comum.
Pra somar/tirar dias/meses/anos de uma data
FUNCTION ze_DateAdd( dDate, nValue, cType )
LOCAL nDay, nMonth, nYear
hb_Default( @cType, "D" )
cType := iif( cType $ "DMY", cType, "D" )
DO CASE
CASE cType == "D"
dDate += nValue
CASE cType == "Y"
dDate := Stod( StrZero( Year( dDate ) + nValue, 4 ) + Substr( Dtos( dDate ), 5 ) )
CASE cType == "M"
nDay := Day( dDate )
nMonth := Month( dDate ) + nValue
nYear := Year( dDate )
IF nMonth < 1
nYear -= Int( Abs( nMonth ) / 12 ) + 1
nMonth += ( Int( Abs( nMonth ) / 12 ) + 1 ) * 12
ENDIF
IF nMonth > 12
nYear += Int( ( nMonth - 1 ) / 12 )
nMonth := Mod( ( nMonth - 1 ), 12 )
ENDIF
DO WHILE Empty( dDate := Stod( StrZero( nYear, 4 ) + StrZero( nMonth, 2 ) + StrZero( nDay, 2 ) ) )
nDay -= 1
ENDDO
ENDCASE
RETURN dDate
ze_DateAdd( Date(), 10, "D" )
ze_DateAdd( Date(), 10, "M" )
ze_DateAdd( Date(), 10, "Y" )
ze_DateAdd( Date(), -10, "D" )
ze_DateAdd( Date(), -10, "M" )
ze_DateAdd( Date(), -10, "Y" )