Date difference between two dates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dibyenduchatterjee
    New Member
    • Apr 2009
    • 5

    #1

    Date difference between two dates

    I have few dates in the format : ' Wed Mar 4 03:11:59 2009 '. I wish to find the difference in days between those dates with current date-time.

    I am using DateTime::Forma t::Strptime module at top. The dates I am getting from DB table in integer format. So converted that in normal date format with code :

    $ptime= scalar localtime($row[3]);

    And this $ptime is having date in the format ' Wed Mar 4 03:11:59 2009 '. I got find the day diff with current day.

    How to do that in perl. Please help...
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    Have a look at CPAN for a date module. There are several that can handle your request.

    --Kevin

    Comment

    Working...