/*
Usage: string formatDateS(string);
Input is a string in the format: 19980828
Where the first four digits are the year, the next two are the month, and the
last two are the day.
The function takes the string, breaks it up and reformats in a short
date format, like : 08/28/1998
Usage: string formatDateL(string);
Input is a string in the format: 19980828
Where the first four digits are the year, the next two are the month, and the
last two are the day.
The function takes the string, breaks it up and reformats in a long
date format, like : August 28, 1998
*/
function dateFormatS($date){
$dy=substr($date,0,4);
$dm=substr($date,4,2);
$dd=substr($date,6,2);
$condate=$dm."/".$dd."/".$dy;
return $condate;
}
function dateFormatL($date){
$dy=substr($date,0,4);
$dm=substr($date,4,2);
$dd=substr($date,6,2);
switch($dm){
case "01":
$dm="January";
break;
case "02":
$dm="February";
break;
case "03":
$dm="March";
break;
case "04":
$dm="April";
break;
case "05":
$dm="May";
break;
case "06":
$dm="June";
break;
case "07":
$dm="July";
break;
case "08":
$dm="August";
break;
case "09":
$dm="September";
break;
case "10":
$dm="October";
break;
case "11":
$dm="November";
break;
case "12":
$dm="December";
break;
}
$condate=$dm." ".$dd.", ".$dy;
return $condate;
}