Help for this page

Select Code to Download


  1. or download this
         # compare ordered date strings
         my $result = sprintf("%04d%02d%02d",@date_1[2,0,1])
                      <=>
    ...
         # $result is -1, 0 or 1, so amend for output
         # to return only 0 or 1;
         return ($result + $result**2)/2;
    
  2. or download this
    # compare ordered date strings
    return sprintf("%04d%02d%02d",@date_1[2,0,1])
           >
           sprintf("%04d%02d%02d",@date_2[2,0,1]);