Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: use of date n time functions

by ZlR (Chaplain)
on Mar 08, 2010 at 10:03 UTC ( #827355=note: print w/ replies, xml ) Need Help??


in reply to use of date n time functions

Or you could parse out the dates with a regex, then use the Date::Calc bazooka to compare theses dates and find the most recent one.

The advantage of this being that you don't have to take into acount tricky dates pitfalls like leap years and so forth, as Date::Calc does that for you.


Comment on Re: use of date n time functions
Re^2: use of date n time functions
by blackgoat (Acolyte) on Mar 09, 2010 at 05:16 UTC
    Could you pls give me a sample showing how to use Date::Calc to compare dates??

      It's all in the Date::Calc help page : look at the recipes

      For instance :

      use Date::Calc qw( Delta_Days ); if (Delta_Days($year1,$month1,$day1, $year2,$month2,$day2) > 0)
      There's also examples about : How do I compare two dates with times? , which might be just what you need.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-07-13 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (249 votes), past polls