in reply to Re: Convert US dates to mySQL dates
in thread Convert US dates to mySQL dates

Well I would do it like the above and I guess the validation could be included also.
$date="24-02-2000"; if ($date =~ /(\d{2})-(\d{2})-(\d{4})/){ $month=$1;$day=$2,$year=$3; print "ERROR month invalid",$month="01","\n" if($1 > 12); print "ERROR day invalid",$day="01","\n" if($2 > 31); print "ERROR year invalid",$year="2000","\n" if($3 > 2100 || $3 < 19 +00); $new_date = $year."-".$month."-".$day; } print "$new_date\n";
You could be as fancy with the validation as you want.
tidy up the code as much as you desire