I have date cell in my db:createDate This is the format Y-m-d. i.e: 2018-10-31
How can i print it on the screen in this format: October 2018
?
I tried this:
echo date ("Y-M", $mainIndex['createDate'])
I have date cell in my db:createDate This is the format Y-m-d. i.e: 2018-10-31
How can i print it on the screen in this format: October 2018
?
I tried this:
echo date ("Y-M", $mainIndex['createDate'])
You were very close :) second parameter should be an integer (time)
echo date ("F Y", strtotime($mainIndex['createDate']));
You can use date format php function something like this
echo date_format($mainIndex['createDate'],"F Y");
For more you can get it from it php date_format and for php date parameters Parameters