From: Morton Goldberg Date: 2008-02-28T02:07:12+09:00 Subject: Re: Getting number of days in a month On Feb 27, 2008, at 11:17 AM, Shandy Nantz wrote: > This is probably an easy question but I am trying to get at the number > of days that are in a month. I have this calendar that I have > built, the > idea being that when a month turns from February to March, for > example, > the calendar should redisplay itself properly formated showing the new > month and the correct number of days. I have it so that it starts > counting the days on the right day of the week, but I have to know > when > to stop counting. Any ideas, Thanks, require "Date" d = Date.new(2008, 2, -1) d.day # => 29 You can find the last day of a month by creating a Date object for day -1. Regards, Morton