|XP is just a number|
Re^2: DateManip Delta_Format Usageby SBECK (Hermit)
|on Jan 13, 2014 at 18:05 UTC||Need Help??|
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.