Reputation: 25
how can I get month name and year from mysql date datatype my date is stored like 2018-12-18 and I want output as Dec 2018
Upvotes: 1
Views: 270
Reputation: 26
SELECT DATE_FORMAT(column_name, "%b %Y") from table_name;
You can also find other date and time functions here
Upvotes: 1
Reputation: 37473
you can try below using date_format() function
SELECT DATE_FORMAT("2018-12-18", "%b %Y");
Upvotes: 1