Dave Rolsky wrote an article a while back about how there are too many date-handling modules in CPAN. When I read it, I thought, "Absolutely, an overhaul is really needed."
Tonight I was reminded once again how bad the situation really is. There are too many modules, alternating between too much and too little. (Just "too", as in "too many notes!") What happened to "simple things should be simple, complicated things should be possible"?
I had six rows of dates, and all I wanted was, "Give me the next business day". After twenty minutes of floundering around with Date::Calc and Date::Calendar and their kin, I gave up, and just looked up each row in a real calendar: "Lessee, Memorial day is the 26th, so it's Tuesday."
I know someone will post a reply of "Just use Date::Foobar" or "In Date::Calc, just get the date in Tasmania and subtract the phase of the moon." You know what? By the time I got through the docs, wading through how to figure the Coptic calendar and the umpteen routines to calculate Easter, I was just too fed up to continue. Do the people that wrote this stuff really use it? Or did they just throw the kitchen sink in there because they could?
I hope the DateTime group makes things better, but frankly, glancing at the modules page makes me wonder if they're just adding fuel to the fire. "Baby Time"? "Pataphysical Calendar"? Yeah, those will be really useful.
Dealing with dates (Score:2, Interesting)
Core modules (Score:3, Informative)
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 [perl.org]! =)
---ict / Spoon
Reply to This
"next business day" is a hard problem (Score:4, Insightful)
- What business?
- What part of the world?
- What exceptions?
So, while it seems easy at first, it's one of the more difficult issues.Reply to This
Re:"next business day" is a hard problem (Score:2)
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 CGI.pm packages up the difficulty for you, giving you a simple interface. That's not the case here.
Not too much (Score:2)
--
xoa
Re:Not too much (Score:1)
Re:Not too much (Score:2)
--
Esli epei eto cumprenan, shris soa Sfaha.
Aettot ibrec epesecoth, spakhea scrifeteis.
Re:Not too much (Score:1)
------------------------------
You are what you think.
Date::Manip (Score:1)
andrew
Re:Date::Manip (Score:1)
However, as I have yet to find a working Win32 version of DateTime, [cpan.org] Date::ICal [cpan.org] does a pretty good job.