use strict; use DateTime::Set; use DateTime::Format::MySQL; my ($d1,$d2) = (DateTime->now(),DateTime->now()->add(days=>7)); my $set = DateTime::Set->from_recurrence( after => $d1, before => $d2, recurrence => sub { $_[0]->truncate(to=>'day')->add(days=>1) }, ); my @dates = map { DateTime::Format::MySQL->format_date($_) } $set->as_list; # @dates now contains a list of MySQL looking date strings