
fashimpaur
User
/ Moderator
Sep 4, 2002, 6:28 AM
Post #10 of 13
(4404 views)
|
Re: [mauto] Date/Time Calculation
[In reply to]
|
Can't Post
|
|
Try using Date::Calc::Add_Delta_YMD(). Time::Piece is primarily to get portions of the localtime() function and simple comparisons. Date::Calc has a method Add_Delta_YMD() where in it is used in the following manner: use Date::Calc qw( Add_Delta_YMD Today Date_to_Text ); ($thisyear, $thismonth, $thisday) = Today(); ($year, $month, $day) = Add_Delta_YMD($thisyear, $thismonth, $thisday, 0, 0, -3); $threedaysago = Date_to_Text($year, $month, $day); print $threedaysago;
Hope that helps. I made the suggestion earlier but you seemed to think that Time::Piece was a better solution and disregarded this. You can also do a PPM install of Date-Calc from activestate to install this PM as well. Good Luck, Dennis $a="c323745335d3221214b364d545". "a362532582521254c3640504c3729". "2f493759214b3635554c3040606a0", print unpack"u*",pack "h*",$a,"\n\n";
|