ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

get first and last day of the current month

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • get first and last day of the current month

    in *ISO date format
    PHP Code:

    /free                                                                      
                                                                               
     isodate  
    = (%date() - %days(%subdt(%date():*days))+%days(1) );            
     
    isodate =(%date()+%months(1))-%days(%subdt((%date()+%months(1)):*days));  
                                                                               
    /
    end-free 
    To MDY 6,0 decimal field directly

    1st day of the current month (*MDY)
    PHP Code:
    DAT1     = %dec(                            
               (%
    date() -                       
               %
    days(%subdt(%date():*days)) +   
               %
    days(1) )                       
               :*
    mdy); 
    last day of the current month (*MDY)
    PHP Code:
     DAT2    =  %dec(                   
                (%
    date() +              
                %
    months(1)) -           
                %
    days(%subdt((%date() + 
                %
    months(1)):*days))     
                :*
    mdy); 
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  • #2
    Re: get first and last day of the current month

    Man is that somewhat confusing. I find it hard to follow, but hey as long as it works.

    Bill
    Bill
    "A good friend will bail you out of jail,
    A true friend would be sitting beside you saying,
    'Wow, that was fun.'"

    Comment

    Working...
    X