Is this what you are looking for? DaysIn (MonthNum)
EDIT 2019-01-20 (for historical purposes)
The comments said the link was broken. Thanks to the online archive , here is the original article.
The code block suggested that it was:
def DaysIn(MonthNum) (Date.new(Time.now.year,12,31).to_date<<(12-MonthNum)).day end
However, as another reader pointed out, it seems that the desired content was probably a few months ago, and not the number of days in a month.
Walt stoneburner
source share