[Omaha.pm] Using Class::Date subclass instead of arrays and Date::Calc

Jay Hannah jhannah at omnihotels.com
Fri Aug 5 15:54:14 PDT 2005


Ooo...

BEFORE:

  use Date::Calc qw( Today Add_Delta_Days );
  $o_ra->set_arrival_date  (sprintf("%04d-%02d-%02d", Today()));
  $o_ra->set_depart_date   (sprintf("%04d-%02d-%02d", Add_Delta_Days(Today(), 1)));

AFTER:

  use Control::DateTime;                       
  my $today = Control::DateTime->new();
  $o_ra->set_arrival_date  ($today);
  $o_ra->set_depart_date   ($today + "1D");

j

(  Control::DateTime is my subclass of Class::Date qw( -DateParse )  )




More information about the Omaha-pm mailing list