My small function is below
My problem is that all it displays is the day and year, but not the month, i'm sure it has somthing to do with the "$month_list[$month]" section, but I don't know.PHP Code:// Date conversion $date is in yyyy-mm-dd format
function dateconvert($date) {
$year = substr($date, 0, 4);
$month = substr($date, 5, 2);
$day = substr($date, 8, 2);
$month_list[01] = "January";
$month_list[02] = "Febuary";
$month_list[03] = "March";
$month_list[04] = "April";
$month_list[05] = "May";
$month_list[06] = "June";
$month_list[07] = "July";
$month_list[08] = "August";
$month_list[09] = "September";
$month_list[10] = "October";
$month_list[11] = "November";
$month_list[12] = "December";
return $month_list[$month] . " " . $day . ", " . $year . ".";
}





Bookmarks