Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 perusing the Monastery: (12)
As of 2014-10-01 09:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (392 votes), past polls