function to get next month

0
how can i get next month using formatdatetime method
asked
1 answers
0

You would need to use the addMonths function on a date to get the next month. 

addMonths([%CurrentDateTime%], 1)

https://docs.mendix.com/refguide/add-date-function-calls/#8-addmonthsutc 

Once you have that, you can then use formatDateTime to get the month. If you wanted this as String and assuming you created the next month in the variable $nextMonth, you could do something like this...

formatDateTime($nextMonth, 'MMMM')

https://docs.mendix.com/refguide/parse-and-format-date-function-calls/#3-formatdatetimeutc
 
Hope this helps.

answered