in reply to Calculating clock time within a period.
I can't test this right now, but I hope it will give you a start:
use strict; use DateTime::Span; use DateTime::Event::Recurrence; my $set1 = DateTime::Event::Recurrence->minutely( interval => 30 ); my $date1 = DateTime->new( year => 2002, month => 3, day => 11 ); my $date2 = DateTime->new( year => 2003, month => 3, day => 12 ); my $set2 = DateTime::Span->from_datetimes( start => $date1, end => $date2 ); my @dt = $set1->intersection( $set2 ); for ( @dt ) { print $_->datetime, "\n"; }
|
|---|