Sunday, July 11, 2010

Perl date manipulation?

I am working with perl 5.8.5-13 and can use perl-Date-Calc-5.4-01. What I would like to do is put a number of days inside of a string that I will parse out. I would then replace that number with today's date plus that number of days. I thought Add_Delta_Days but it seems to fail as soon as I wrap over the current week and informs me that Date-Calc version 8 could perform this operation. Are there any suggestions on how to work around this? I would be open to other popular date manipulation modules.

Perl date manipulation?
use Date::Manip;


my $days = 14;


my $newdate = DateCalc('today' , " + $days days");
Reply:Every Perl distro should have the POSIX module. I've heard that this is capable of date manipulation try that out!


No comments:

Post a Comment