Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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, 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064235]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2018-03-18 13:58 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (230 votes). Check out past polls.