$test_date = "12-02-2001"; if ($test_date =~ s/^([0-1]?\d)\-([0-3]?\d)\-([0-9]{4})$/$3\-$1\-$2/) +{ print $test_date; } else { print "boom"; }
HTH,
Update thought about it, shortened it and corrected it. Sorry for the original error in it.
EEjack
In reply to Re: Convert US dates to mySQL dates
by eejack
in thread Convert US dates to mySQL dates
by filmo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |