Hi monks, I'm having a problem with the Date::Set module. I need to work with recurrence and pretty detailed recurrence also. I've googled all kinds of searches on recurrence modules and the most advanced, so far I've found is Date::Set.

Now to my problem. I've found a few examples, but whenever I run them they never come up to what the example says it should. I tried Example 3 here... Example 3 (Not example 2.)
use Date::Set; # when the event occurs: every friday. my $set = Date::Set->event ( rule => 'FREQ=WEEKLY;BYDAY=FR'); # in what period we want occurences: december 2002 my $period = Date::Set->period (time => ['20021201', '20021231']); my @occurs = $set->during (at => $period)->list; print "occurences on ", join (" ,", @occurs), "\n";
I get this...
occurences on

There is nothing in the array when clearly there should be. That's the first problem. I've also tried a few small examples like this one...
use Date::Set; $a = Date::Set->event(); $a->event( rule => 'FREQ=MONTHLY;INTERVAL=2;' ); $a->event( start => '20030801', end => '20031201' ); @list = $a->list; foreach (@list) { print "$_\n"; }
This prints off...
19700820T200641Z

I've tried other examples like this...
$a = Date::Set->event( rule => 'FREQ=YEARLY;INTERVAL=2' ); $a->during( start => '20030801', end => '20200801' ); print $a . "\n";
This prints off...
19700820T200641Z

Am I missing something? Is there some kind of a time zone setting I need to make or am I not using the module correctly? A few examples I've used came right from the cpan module documentation. Also, Date::Set installed through cpan correctly, and all it's dependencies. I can duplicate these exact results on my small linux machine here at home and one of our linux servers at the office.

Thanks for any help you can provide.

In reply to Date::Set not returning correct results. by the_0ne

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.