following is a function that can be used to convert numeric date to alphabetic date, e-g from 2015-11-16 to 16 Nov, 2015.
1. Function takes 3 parameters, numeric date, locale and length of month
2. Function currently supports EN and ES month names.
3. Function can be calles as <?php convertDate("2015-11-16","en","full"); ?>
<?php
function convertDate($date,$locale,$length){
$monthNames = array(
"en" => array(
"full" => array(1=>'January','February','March','April','May',
'June','July','August','September','October','November','December'),
"short" => array(1=>'Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec')
),
"es" => array(
"full" => array(1=>'Enero','Febrero','Marzo','Abril','Mayo',
'Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Deciembre'),
"short" => array(1=>'Ene','Feb','Mar','Abr','May','Jun',
'Jul','Ago','Sep','Oct','Nov','Dec')
),
);
$exploded = explode("-",$date);
$year = $exploded[0];
$month = $exploded[1];
$day = $exploded[2];
$month = $monthNames[$locale][$length][$month];
$date = $day . " " . $month . ", " . $year;
return $date;
}
?>