function DateFormat($val,$full) { $a = explode("-",$val); if ($full == "S" || $full == "s") { switch ($a[1]) { case 1 : $mon = "Jan"; break; case 2 : $mon = "Feb"; break; case 3 : $mon = "Mar"; break; case 4 : $mon = "Apr"; break; case 5 : $mon = "May"; break; case 6 : $mon = "Jun"; break; case 7 : $mon = "Jul"; break; case 8 : $mon = "Aug"; break; case 9 : $mon = "Sep"; break; case 10 : $mon = "Oct"; break; case 11 : $mon = "Nov"; break; case 12 : $mon = "Dec"; break; } } else { switch ($a[1]) { case 1 : $mon = "January"; break; case 2 : $mon = "February"; break; case 3 : $mon = "March"; break; case 4 : $mon = "April"; break; case 5 : $mon = "May"; break; case 6 : $mon = "June"; break; case 7 : $mon = "July"; break; case 8 : $mon = "August"; break; case 9 : $mon = "September"; break; case 10 : $mon = "October"; break; case 11 : $mon = "November"; break; case 12 : $mon = "December"; break; } } $value = "$a[2] $mon $a[0]"; return $value; }