Search code examples
jasper-reports

How to get month name in jasper studio expression editor


I am using this command to get the date in jasperstudio expression editor

new SimpleDateFormat("dd.MM.yyyy").format($F{day_date})

This will return date value example like 01.01.2010 however i want the month to have a name like 01.Jan.2010 -- please advise


Solution

  • In your specified format "dd.MM.yyyy", MM gives you the month as a number.

    You can use "dd.MMM.yyyy" to get an abbreviated month name.

    Similarly, if you need the full month name you can use "dd.MMMM.yyyy"