As far as I can tell, because Date::Manip uses it's own/ISO representation internally for dates, times and delta's, Gregorian -v- Julian -v- other calander systems aside, it should do the right thing for pretty much any set of dates that you want to throw at it. I haven't personnally verified this, but the module's been around long enough that any such fopars would probably have shown up by now.

As for that code that I posted (besides being bug-ridden), it's just long strings of 1's and 0's, so there shouldn't be any problems as your only representing days. However it may not accurately account for leap days as you can't represent 0.2439 (from memory) days in a bit or byte. Meaning that if you need the kind of accuracy that would account for this, the method may not be useful to you. People joining or leaving on Feb 29th, or counts of active members on ranges that start or finish on Feb 29th could be mis-counted. I can't see an easy fix for this.

The only other comment is that with a range of 50+ years and 4500+ members, the storage requirements rise to close to 80 MB. Moving to using a bit/day instead of byte/day this would reduce to 10MB which might be worth the effort, but vec isn't a direct substitute for substr unfortunately, so the code gets more complicated.


Examine what is said, not who speaks.

The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.


In reply to Re: Re: Re: Multiple date ranges by BrowserUk
in thread Multiple date ranges by AndyH

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.