PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08/14/2019 4:01 PM by  Scooter
How to calculate last day of current month
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Scooter
Private
Private
Veteran Member
(119 points)
Veteran Member
Posts:55


Send Message:

--
08/14/2019 2:46 PM

    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
    Programmer/Analyst
    WoodmenLife
    Veteran Member
    (332 points)
    Veteran Member
    Posts:122


    Send Message:

    --
    08/14/2019 3:23 PM
    
    // 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); 
    Scooter
    Private
    Private
    Veteran Member
    (119 points)
    Veteran Member
    Posts:55


    Send Message:

    --
    08/14/2019 4:01 PM
    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.
    You are not authorized to post a reply.