in reply to Re: DateManip Delta_Format Usage
in thread DateManip Delta_Format Usage
Sorry for the tardy reply... I don't get on perl monks more often than every few days.
The original post doesn't include the version they are using which is unfortunate. I'm assuming that it's from the pre 6.00 era. The '%dyd' style formats are from the newer version of Date::Manip, so they won't work with a 5.xx era script.
Also, the original post said he expected (not sure if it was good or bad) around 60+ days for both types of delta, and that shouldn't be a desired result since a business delta by definition is excluding a bunch of days (weekends) so it should be smaller by a factor of approximately 5/7.
If I wanted to know how many days were in the deltas, I'd do the following:
#Standard Days my $standard_delta = DateCalc($start,$end,0); my $standard_days = Delta_Format($standard_delta,2,'%dt'); print "$standard_delta :: $standard_days\n"; #Business Days my $business_delta = DateCalc($start,$end,3); my $business_days = Delta_Format($business_delta,2,'%dt'); print "$business_delta :: $business_days\n";
and the results were:
+0:0:9:4:0:0:0 :: 67.00 +0:0:0:47:0:0:0 :: 47.00
Note that I changed the business day calc mode to 3 (which is an exact business delta). By treating both exactly, you get accurate numbers which you won't get with approximate deltas.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: DateManip Delta_Format Usage
by wjw (Priest) on Jan 13, 2014 at 20:15 UTC | |
|
Re^3: DateManip Delta_Format Usage
by nabrown737 (Initiate) on Jan 13, 2014 at 22:47 UTC | |
by SBECK (Chaplain) on Jan 14, 2014 at 19:02 UTC |