Carl,
Assuming that the 2 formats you mention in your post are the only ones you need to parse, and the date to format is stored in $date, the following code should do the trick:
if (preg_match("/(\d{4}[-]\d{2}[-]\d{2}) /", $date)) {
$tmp = explode(" ", $date);
$date = explode("-", $tmp[0]);
echo "Formated date: <b>" . strtoupper(date("F-d-y", mktime(0, 0, 0, $date[1], $date[2], $date[0]))) . "</b>";
}
else if (preg_match("/(\D*[ ]\d{2}) /", $date)) {
$tmp = explode(" ", $date);
echo "Formated date: <b>" . strtoupper($tmp[0]) . "-" . $tmp[1] . "-" . substr($tmp[3], 2) . "</b>";
}
else {
echo "I don't know how to parse dates in the format: $date🙁";
}
HTH.
geoff