3
I have some graphics using IReport
, in one of them needed to show the date in "month/year" format.
Using the code:
DATE_FORMAT(data,'%m/%y') as mesAno
can only show in English format (as image below), but precise in "pt BR" format for example: Aug/2015, May/2015.
I didn’t want to touch the Mysql settings for this.
This code snippet makes it possible to display month names in "en BR".
CASE MONTHNAME(data) "
+ "when 'January' then 'Janeiro'\n"
+ "when 'February' then 'Fevereiro'\n"
+ "when 'March' then 'Março'\n"
+ "when 'April' then 'Abril'\n"
+ "when 'May' then 'Maio'\n"
+ "when 'June' then 'Junho'\n"
+ "when 'July' then 'Julho'\n"
+ "when 'August' then 'Agosto'\n"
+ "when 'September' then 'Setembro'\n"
+ "when 'November' then 'Novembro'\n"
+ "when 'December' then 'Dezembro'"
+ " END as mes
It would have something like this for the month/year format?
I found on some websites this code:
SET lc_time_names = "pt_br" ;
But I couldn’t find a way to apply mine query
.
If anyone can help, thank you.
Possible duplicate of: Convert Date field data to Mysql month
– rray