From: Russell Tracey Date: 2006-09-23T04:06:05+09:00 Subject: Re: Calculate last day of month Hunter Walker wrote: > This is probably an easy one for somebody, but I couldn't figure it out > using the Date class in the documentation. > > > > require 'date' > > > d = Date.new(2006, 9,16) > > > How do I return the date for the last day of this month (September in > this example)? > > > > Thank you for your help! > > > -Hunter Date.new(2006, 9,-1) -1 means count backwards in this context. more info at http://www.ruby-doc.org/core/classes/Date.html#M001193 -- Posted via http://www.ruby-forum.com/.