I was at work and am getting into this one late, but there it is.

I would like to have something that handles the different month lengths, 
and not just February.  I checked to see what the value of a day was 
this way:

p Time.gm(2007, 'feb', 2, 1, 1, 1) - Time.gm(2007, 'feb', 1, 1, 1, 1)

returns 86400 which is the number for exactly one day.

Therefore, I have this approach to get the day:

t = Time.gm(2007, 'feb', 1, 1, 1, 1) #  to find for January
p (t - (one_day * t.wday)).day

:)

-- 
Posted via http://www.ruby-forum.com/.