Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#my $date = "$mon/$mday/$year"; my $date = "10/13/2006"; if ($date=~/(\d{1})\/(\d{2})\/(\d{4})/){ $date="0".$1."\/".$2."\/".$3; print "<br>L1 - $date<br>"; }elsif($date=~/(\d{2})\/(\d{1})\/(\d{4})/) { $date=$1."\/0".$2."\/".$3; print "<br>L2 - $date<br>"; }else{ $date=~/(\d{1})\/(\d{1})\/(\d{4})/; $date="0".$1."\/0".$2."\/".$3; }
formatting cleaned up by GrandFather
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching Date
by blazar (Canon) on Oct 13, 2006 at 14:36 UTC | |
by kwaping (Priest) on Oct 13, 2006 at 14:41 UTC | |
|
Re: Matching Date
by Hue-Bond (Priest) on Oct 13, 2006 at 14:41 UTC | |
|
Re: Matching Date
by johngg (Canon) on Oct 13, 2006 at 15:03 UTC | |
by Anonymous Monk on Oct 13, 2006 at 15:31 UTC | |
|
Re: Matching Date
by RobPayne (Chaplain) on Oct 13, 2006 at 14:42 UTC | |
|
Re: Matching Date
by Skeeve (Parson) on Oct 13, 2006 at 14:43 UTC | |
|
Re: Matching Date
by fenLisesi (Priest) on Oct 13, 2006 at 17:24 UTC |