There are so many date and time modules on CPAN, it's scary. It's similar to the situation with template modules and DBI wrappers. I've been thinking of trying to write "the one true date/time" module, primarily by ripping apart the other modules and producing something that did all the useful things they do, but with a consistent API.
It'd be a cool thing to have, but I'm tired right now. Maybe later in the year.
Date::ICal + Time::Piece? (Score:2)
Is there anything that a combination of those two would miss?
Re:Date::ICal + Time::Piece? (Score:1)
Power of Date::Manip and/or Date::Parse when it comes to parsing dates?
Ilya Martynov (http://martynov.org/ [martynov.org])
Re:Date::ICal + Time::Piece? (Score:2)
What I mean is, isn't it better to specify X different acceptable formats than just hope the magic internals of a library will make it all work for you? Time::Piece lets you do that with it's strptime support.
Re:Date::ICal + Time::Piece? (Score:2)
Re:Date::ICal + Time::Piece? (Score:1)
I think so. My date parsing mostly involves dates in Dutch (and English). Ideally, the module should be able to parse that... but on the other hand, I don't want it to be so bulky that it also contains the code to parse dates in Mongolian.
So my idea would be: let the user do the parsing with, say, a regex, and pass the data to the built-in function, together with an array of the month names
Re:Date::ICal + Time::Piece? (Score:2)
So my idea would be: let the user do the parsing with, say, a regex, and pass the data to the built-in function, together with an array of the month names — or day names, depending on what you're trying to parse. And let the function figure it out from there.
Uh,
Re:Date::ICal + Time::Piece? (Score:1)
Re:Date::ICal + Time::Piece? (Score:2)
If all you're after is basic parsing then the Date::Parse module does that just fine in a couple hundred lines of code. Re-implementing either of those as a one-off would be foolish. Mandating that people re-implement them is ridiculous.
Re:Date::ICal + Time::Piece? (Score:1)
That was the hard part. No
Re:Date::ICal + Time::Piece? (Score:2)
That was the hard part. Now we have all the elements we need to interpret this date. Do I need to use a, possibly large, date module? Hell, no, as a simple hash lookup is all we need to turn the month name into a month number. I'm not talking about hundreds of lines of code, obviously.
Ok, then don't use it for this particular purpose. This module will be more useful for people who have to deal with date calculations than those who just need to parse really simple date formats.
I've never had the
Re:Date::ICal + Time::Piece? (Score:2)
- Date objects
-- Simple OO interface for doing basic things. I like how Time::Piece does this.
-- Date math via overloading. Time::Piece and Time::Seconds are not bad. Looks like Date::ICal has support for more complex date math.
-- Works outside of epoch times. Date::ICal does this.
-- Simple date parsing. Time::Piece->strptime plus the functionality of Date::Parse would be good.
-- Complex date parsing. Date::Man
Re:Date::ICal + Time::Piece? (Score:2)
I think that this is a great idea, overall. My only requests would be that a) the different functionalities be in related modules, so that you only load what you need; and b) that it be fast -- very fast.
Perhaps you should start a project or at least a discussion list of some kind so that interested parties can contribute and collaborate on a design spec? I'd sign up. Hopefully Matts would have time to participate, too!
--David
Re:Date::ICal + Time::Piece? (Score:1)
This was already tried a while ago and it didn't go over well.
Review the archive of datetime@perl.org:
http://archive.develooper.com/datetime@perl.org/ [develooper.com]
-- tex
Re:Date::ICal + Time::Piece? (Score:2)
I think Rich was just too damn nice about the whole thing. Anyway, I just posted a new proposal to that mailing list, so anyone interested should sign up.
Re:Date::ICal + Time::Piece? (Score:2)
Re:Date::ICal + Time::Piece? (Score:1)
Re:Date::ICal + Time::Piece? (Score:1)
Do the days that are treated as business days vary between countries. Here in the UK Monday to Friday are business days (and have been for the past century or two), and I assume that this is true in most or all (notionally) Christian countries. But do countries where other religions are dominant observe different business days?
Re:Date::ICal + Time::Piece? (Score:2)
Uh, I'll give you one guess