Subtracting months from a date

0
Hi all,  I have the following attributes: Date 1: 31/12/18 Date 2: Number of Months (integer): 6 months  I would like to to subtract the number of months from Date 1 and that generates Date 2. So with the above example it would be 31/12/18 - 6 months = 31/6/18. I am currently going through microflow expressions so trying to learn this, but any help would be appreciated :) Many thanks,   Garion
asked
1 answers
1

See the documentation here: https://docs.mendix.com/refguide/add-date-function-calls

So use addMonths($date1,-$nrofMonths)

Note that you should add UTC(addMonthsUTC) if working with UTC dates.

Regards,

Ronald

 

answered