Question

2
Replies
5504
Views
Close popover
Thomas Lorriette (ThomasL8)
Iriz Consulting
System Architect
Iriz Consulting
GB
ThomasL8 Member since 2016 17 posts
Iriz Consulting
Posted: June 26, 2017
Last activity: June 27, 2017
Closed
Solved

Add one month to date, but keep exact same day or last day of the month if higher

Hello.
I have the following requirement: for a given DateTime, I need to get the same date + one month. However, if the day is, for example, the 31st, and the following month has only 30 days or less, I need it be the last day of the following month.

I could have use a function to add days and add 30 days to the current date, or use an existing function to add one month, but I'm affraid the date could shift on the next month (like changing from 26 to 25 of the month).

In practice, these are some example of results I'd like to have:
26/06->26/07->26/08...
01/06->01/07->01/08...
31/05->30/06->31/07...
30/06->30/07->30/08...

Is there an ootb existing function for this? Or do I need to use java code or activity for this?

Thanks in advance.

Low-Code App Development Data Integration Java and Activities
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.