Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I'm coming to believe that one of the fastest ways of converting a string date to an integer is via table lookup. Look at the string just long enough to figure out which table (or hash, or whatever) to do the lookup from, then use the string as a key. A classic space-for-time trade-off. And with ~365.25 distinct dates per year, it's really not all that much space to deal with 20 years worth of days, even in multiple formats.
  • Core modules (Score:3, Informative)

    Odds are, you won't ever need a DateTime::Calendar module.

    Odds are, you won't ever need half the Format modules.

    DateTime itself, DateTime::(Set|Span), and probably one or two of the format modules (probably Strptime or Builder since they're the most generic), are all most people will need. [Though Builder needs some refactoring since its simple cases have gotten a bit too complex.]

    I don't think anyone's bothered to write business day stuff yet. Contributions are welcome, of course =) I think someone was working on representing holidays and such, which would be useful for such a module.

    Join the list []! =)
      ---ict / Spoon
  • Give me the next business day
    Well, actually, you happen to pick one of the harder problems just then. You can state the problem easily, but then you have to answer a lot of questions:
    • What business?
    • What part of the world?
    • What exceptions?
    So, while it seems easy at first, it's one of the more difficult issues.
    • Randal L. Schwartz
    • Stonehenge
    • Exactly, I realize it's nontrivial; that's why I went to find a module rather than roll my own. My point was that the interface and documentation were so complicated that the modules ended up not being of any help. As a contrasting example, CGI parameter parsing can be tricky, but packages up the difficulty for you, giving you a simple interface. That's not the case here.

  • What we really need is a date/time handling module that is also a text templating system.


  • I have always just used Date::Manip [] it even has &Date_NextWorkDay. Dunno if that helps, or complicates issues :-)
    • Except that its huge and written in pure Perl, thus can be slower than smaller modules or ones written in C.

      However, as I have yet to find a working Win32 version of DateTime, [] Date::ICal [] does a pretty good job.