如何获得正在进行的月结束日期4gl

Dar*_*nor 5 progress-4gl

我怎样才能获得正在进行的月份的最后一天4gl?

Tom*_*com 11

/* the last day of this month is one day less than the first day of next month
 *
 * so add one month to the first day of this month and then subtract one day.
 *
 */

function lastDay returns date ( input d as date ):

  return add-interval( date( month( d ), 1, year( d )), 1, "month" ) - 1.

end.
Run Code Online (Sandbox Code Playgroud)