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 -14))
is there any simple method to find Second Sunday of March.
If anyone knows kindly help me…
On Fri, Nov 12, 2010 at 7:22 AM, Rajaa Ramanathan [email protected] wrote:
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…
Come on, that’s really not difficult. Start with the first day of
March and go from there. Knowing how many days there are in a week
should be sufficient. Note also, that you can use math operators on
Date instances (see “ri Date”).