We'd like to see what you have tried so we can provide better help. Otherwise, you may like to take a look at Date::Manip (the kitchen sink module for date manipulation).
True laziness is hard work
Comment on Re: Calculating latest 'Sunday' date on the first of the month