use DateTime::Event::Recurrence; # Second Tuesday of every month: # my $set = DateTime::Event::Recurrence->monthly( weeks => 2, days => 2 ); my $it = $set->iterator(start => DateTime->now()); for (1 .. 10) { my $dt = $it->next(); print "$dt\n"; }
2010-09-14T00:00:00 2010-10-12T00:00:00 2010-11-09T00:00:00 2010-12-14T00:00:00 2011-01-11T00:00:00 2011-02-15T00:00:00 2011-03-15T00:00:00 2011-04-12T00:00:00 2011-05-10T00:00:00 2011-06-14T00:00:00 This correctly prints the remaining second Tuesdays for 2010 but in 2011 it includes Feb 15th which is the 3rd Tuesday. What's up with that?