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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Wheel, reinvented (Score:2)
All achieve the same thing.
Re:Wheel, reinvented (Score:2)
Date::CalcandDate::Manipmight also do the same thing. Could be wrong though as it's been a while since I've looked...Re:Wheel, reinvented (Score:2)
Oh, I know about Time::Seconds (I'm a big advocate of using Time::Piece). This isn't my attempt to replace it, just something that I was playing around with that I thought I'd share.
There are differences between the two module tho'. Time::Seconds uses exported symbolic constansts where Time::Period uses objects. Also adding one year or one month to a date using Time::Seconds will add a fixed number of seconds whereas Time::Period will really add one year or one month.
Didn't know about Date::ICal::Durati
Re:Wheel, reinvented (Score:2)
1m (Score:1)
Re:1m (Score:2)
Yeah, it's really unhelpful that "month" and "minute" both beign with "m" :(
To get round that I arbitrarily decided that lower case letters represent units of time that are a day or bigger and uppercase letters represent untis of time that are smaller than a day. Another way of putting it is that lower case letters represent dates and upper case letters represent times.
So '1m' is one month. '1M' is one minute.
Thanks, minor niggles (Score:2)
Niggles on the module:
print Time::Period->new("1y") - Time::Period->new("1S")returns"1y, 1S"which is obviously wrong.print Time::Duration->new("24H")*2does not DWIM, it complains about*, but I see that's on your TODORe:Thanks, minor niggles (Score:2)
Can I have half an hour?
Addition is the only operation that is currently documented. Therefore it's the only one you should expect to work as documented :)