Help for this page

Select Code to Download


  1. or download this
    $source =~ m!(\d{1,2})[-/](\d{1,2})[-/](\d{2,4})!g;
    my $day = $1;
    ...
    }else {
        $day .= 'th';
    }
    
  2. or download this
    $day .= ( $day == 1 or $day == 21 or $day == 31 ) ? 'st' :
            ( $day == 2 or $day == 22 ) ? 'nd' :
            ( $day == 3 or $day == 23 ) ? 'rd' :
            'th';