From: Mohit Sindhwani Date: 2007-09-26T23:11:52+09:00 Subject: Re: Finding the last Sunday of a month Peter Bailey wrote: > Thanks to all of you. Mohit's worked for me. It's quite ingenious, > actually, because it's simply subtracing the date of the week, which is > 3 for Wednesday, from 31, the last day of the month. 31 - 3 = 28, so, > Sunday is the 28th. I love Ruby! > > Thanks again, > Peter > > Actually, I think mine just reached your first but everyone had essentially the same suggestion. By the way, the suggestion about subtracting from the 1st of the next month is perhaps smarter! That way, you don't hv to worry about what the last day of the month is (31, 30, 28, 29?) I think it's really smart to just avoid all of that and go back from the start of the next month! Cheers, Mohit. 9/26/2007 | 10:11 PM.