Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get end of month date in progress 4gl

Tags:

progress-4gl

How can I get the last day of the month in progress 4gl?

like image 955
Daria Trainor Avatar asked Jun 19 '12 04:06

Daria Trainor


1 Answers

/* 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.
like image 150
Tom Bascom Avatar answered Sep 19 '22 12:09

Tom Bascom