From: Reid Thompson Date: 2010-11-13T11:04:31+09:00 Subject: Re: To find 2nd Sunday of March On 11/12/2010 1:22 AM, Rajaa Ramanathan wrote: > All, > I have used the following code to find the second Sunday of march. > lastdate_of_march = Date.new(current_year, 3, 31) > i = lastdate_of_march.wday > second_sunday = Date.new(current_year, 3, (31-i)) > > is there any simple method to find Second Sunday of March. > If any ! knows kindly help me.. > > Regards, > Rajaa > rthompso@raker>~ $ irb irb(main):001:0> require 'chronic' => true irb(main):002:0> Chronic.parse('2nd sunday in march', :context => :future) => Sun Mar 13 13:00:00 -0400 2011 irb(main):003:0> Chronic.parse('2nd sunday in march', :context => :past) => Sun Mar 14 13:00:00 -0400 2010 irb(main):004:0> irb(main):005:0> Chronic.parse('2nd sunday in march') => Sun Mar 13 13:00:00 -0400 2011