dDataDataRequired
Base date used in the calculation.
AdvPL GuideAddMonth( <dData>, <nMeses> ) --> dDataAdds or subtracts months from a date while keeping the date type.
AddMonth() is useful when a business rule works with due dates, projections, installments or validity periods measured in months. Instead of adding a fixed number of days, it moves the date by the informed number of months.
AddMonth( <dData>, <nMeses> ) --> dDatadDataBase date used in the calculation.
nMesesNumber of months to add. Use a negative value to go back.
#Include "TOTVS.ch"
User Function ExAddMonth()
Local dDueDate := AddMonth(Date(), 3)
MsgInfo("Due date: " + DToC(dDueDate))
ReturnShows the current date plus three months.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.