in reply to code to get the date for "next Thursday"
use DateTime; use DateTime::Event::Recurrence; my $thu = DateTime::Event::Recurrence-> weekly(days => 4); # Thursday my $days = DateTime::Event::Recurrence-> daily(); my $set = $thu->intersection($days); my $it = $set->iterator( start => DateTime->today() ); if(my $dt = $it->next()) { print "Next Thursday from today: $dt\n"; }
|
|---|