Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Setting up date to subtract specific number from it

by sundialsvc4 (Abbot)
on Nov 25, 2013 at 16:07 UTC ( #1064235=note: print w/ replies, xml ) Need Help??


in reply to Setting up date to subtract specific number from it

Well, if you just search for “date” at http://search.cpan.org, you will today get 5000 hits ...

Some suggestions of packages that I have used very often:

  • DateTime will do absolutely anything with a date.   Takes a bit of time to grok its examples, but once you do, it’s worth it.
  • Date::Manip is another object-oriented interface for dates.   Again, there is a learning curve.
  • Date::Simple ... well, it’s simple.   Put down your Swiss Army® knife and grab this pocket-knife which happens to have the blades you use most often.

But there are literally thousands more, including some pure-fun ones.   Search as-above for “DateTime Calendar” and then get your time-machine ready:   DateTime::Calendar::Mayan, DateTime::Calendar::FrenchRevolutionary, DateTime::Fiction::JRRTolkien::Shire ...

The one thing you don’t have to do in Perl is to “write your own” routines to handle positively anything that has to do with dates/times.   I find it very convenient to use the packages which define a date-time object, i.e. “this thing ‘is a’ date/time, its internal implementation is blissfully opaque, and I can tell it to do things and ask it questions and It Just Works.™”   Functional interfaces are much more baroque due to the sheer number of options that must be supported by a thorough handling of dates.


Comment on Re: Setting up date to subtract specific number from it

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064235]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2015-07-29 18:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (267 votes), past polls