Calculate last day of month

Slightly nicer is:
puts Date.new(2006, 9, -1)
#2006-09-30

Well, aren't you Mr. Tricky? :slight_smile:

Here's the documentation For Date.civil() describing the feature Norgg
describes:

"Create a new Date object for the Civil Date specified by year y, month
m, and day-of-month d.

m and d can be negative, in which case they count backwards from the end
of the year and the end of the month respectively. No wraparound is
performed, however, and invalid values cause an ArgumentError to be
raised."

路路路

From: Norgg [mailto:xennocide@yahoo.com]

that is damn cool. missed that.

-a

路路路

On Fri, 22 Sep 2006, Gavin Kistner wrote:

From: Norgg [mailto:xennocide@yahoo.com]

Slightly nicer is:
puts Date.new(2006, 9, -1)
#2006-09-30

Well, aren't you Mr. Tricky? :slight_smile:

Here's the documentation For Date.civil() describing the feature Norgg
describes:

"Create a new Date object for the Civil Date specified by year y, month
m, and day-of-month d.

m and d can be negative, in which case they count backwards from the end
of the year and the end of the month respectively. No wraparound is
performed, however, and invalid values cause an ArgumentError to be
raised."

--
in order to be effective truth must penetrate like an arrow - and that is
likely to hurt. -- wei wu wei