This is an array that contains the months in Greek:
$greekMonths = array('Ιανουαρίου','Φεβρουαρίου','Μαρτίου','Απριλίου','Μαΐου','Ιουνίου','Ιουλίου','Αυγούστου','Σεπτεμβρίου','Οκτωβρίου','Νοεμβρίου','Δεκεμβρίου');
And this is the code that tries to display date of this format-29 May 2016-in Greek,the month must be in greek:
$dat=new DateTime($value['date_URL']);//$value['date_URL'] is the date format in English
$dt=$dat->format('d'.' '.$greekMonths[(date('n'))-1] .' '.'Y');
echo $dt;
The problem with the code you see above is that the month is always May(in greek of course).
If for example $value[‘date’] is 2016-07-25 I get back with the above code:
25-May-2016(the month(may in this example) depicted in Greek)
Of course the correct must 25-July-2016.
I cannot understand why this is happening…the month that is displayed is always may,the current one…whatever the input date might be.