#!/usr/bin/perl -- use strict; use warnings; use DateTime::Event::Recurrence; { my $dt1 = new DateTime( year => 2008 ); my $dt2 = new DateTime( year => 2009 ); my $der = DateTime::Event::Recurrence->weekly; print $_->ymd, ' ', ,$/ for $der->as_list( start => $dt1, end => $dt2 ); } # http://datetime.perl.org/index.cgi?FAQDurationsSetsSpans __END__
2008-01-07 2008-01-14 2008-01-21 2008-01-28 2008-02-04 2008-02-11 2008-02-18 2008-02-25 2008-03-03 2008-03-10 2008-03-17 2008-03-24 2008-03-31 2008-04-07 2008-04-14 2008-04-21 2008-04-28 2008-05-05 2008-05-12 2008-05-19 2008-05-26 2008-06-02 2008-06-09 2008-06-16 2008-06-23 2008-06-30 2008-07-07 2008-07-14 2008-07-21 2008-07-28 2008-08-04 2008-08-11 2008-08-18 2008-08-25 2008-09-01 2008-09-08 2008-09-15 2008-09-22 2008-09-29 2008-10-06 2008-10-13 2008-10-20 2008-10-27 2008-11-03 2008-11-10 2008-11-17 2008-11-24 2008-12-01 2008-12-08 2008-12-15 2008-12-22 2008-12-29

In reply to Re^2: What is the best way to get a list of all Mondays until the end of the year? by Anonymous Monk
in thread What is the best way to get a list of all Mondays until the end of the year? by wenD

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.