Rpaguilar has asked for the wisdom of the Perl Monks concerning the following question:
#!/cgi-bin/perl -w use CGI; # get the form data $query = new CGI; $textInput=$query->param('textInput'); #start the html page print $query->header; print $query->start_html(-title=>"Ric's"); print "<FONT SIZE='5'>\n"; print "The text entered was:<HR>\n"; print "</FONT>\n"; { print "$textInput<BR>\n"; } ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localt +ime(time); $year =~ s/^\d(\d\d)$/$1/; $mon++; if(length($mon) < 2){$mon = "0" . $mon;} if($year > 90) {$year = "19" . $year;} else{$year = "20" . $year;} if($min < 10){$min= "0$min";} $textInput = "$mday/$mon/$year"; @month = ("-", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); @monthPost = ("-", "st", "nd", "rd", "th", "th", "th", "th", "th", "th +", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "st", "nd", "rd", "th", "th", "th" +, "th", "th", "th", "th", "st"); $textInput = "$mday$monthPost[$mday] $month[$mon] $year"; print "$textInput";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Date pattern matching
by grep (Monsignor) on Nov 03, 2002 at 21:34 UTC |