How to calculate last day of current month

 2 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Scooter
Veteran Member Send Private Message
Posts: 83
Veteran Member

In processflow, we need the last day of current month. 

This last day of month value will be used in batch pgm parm date, i.e. BN100, Thru-Date=20190831 

Has anyone does this before? Is there an Infor PF date function that can do this?

 

Kyle Jorgensen
Veteran Member Send Private Message
Posts: 122
Veteran Member
[code] // current date jsDate = today(); // set month to the next month jsDate.setMonth(jsDate.getMonth() + 1); // set day to the first jsDate.setDate(1); //subtract one day endOfCurrentMonth = AddDay(jsDate,-1); [/code]
Scooter
Veteran Member Send Private Message
Posts: 83
Veteran Member
Thanks Kyle.
I was able to calculate the last day of the month using IPA functions but it took many more lines of code than your simpler code. I'll use your code in the future.